Class LoggingConfiguration


  • public class LoggingConfiguration
    extends org.stagemonitor.configuration.ConfigurationOptionProvider
    Defines configuration options related to logging.

    This class is a bit special compared to other ConfigurationOptionProviders, because we have to make sure that wie initialize the logger before anyone calls LoggerFactory.getLogger(Class). That's why we don't read the values from the ConfigurationOption fields but iterate over the ConfigurationSources manually to read the values (see Log4j2ConfigurationFactory.getValue(java.lang.String, java.util.List<org.stagemonitor.configuration.source.ConfigurationSource>, java.lang.String)).

    It still makes sense to extend ConfigurationOptionProvider and register this class as a service, so that the documentation gets generated for the options in this class.

    • Field Detail

      • AGENT_HOME_PLACEHOLDER

        public static final java.lang.String AGENT_HOME_PLACEHOLDER
        See Also:
        Constant Field Values
      • DEFAULT_MAX_SIZE

        public static final java.lang.String DEFAULT_MAX_SIZE
        See Also:
        Constant Field Values
      • LOG_FORMAT_FILE_KEY

        public static final java.lang.String LOG_FORMAT_FILE_KEY
        See Also:
        Constant Field Values
      • logFile

        public org.stagemonitor.configuration.ConfigurationOption<java.lang.String> logFile
      • logFileSize

        public org.stagemonitor.configuration.ConfigurationOption<ByteValue> logFileSize
      • logFormatSout

        public org.stagemonitor.configuration.ConfigurationOption<LogFormat> logFormatSout
      • logFormatFile

        public org.stagemonitor.configuration.ConfigurationOption<LogFormat> logFormatFile
    • Constructor Detail

      • LoggingConfiguration

        public LoggingConfiguration()
    • Method Detail

      • init

        public static void init​(java.util.List<org.stagemonitor.configuration.source.ConfigurationSource> sources,
                                java.lang.String ephemeralId)
      • getLogFile

        public java.lang.String getLogFile()
      • isLogCorrelationEnabled

        public boolean isLogCorrelationEnabled()
      • getLogEcsFormatterAllowList

        public java.util.List<WildcardMatcher> getLogEcsFormatterAllowList()
      • getLogEcsFormattingDestinationDir

        @Nullable
        public java.lang.String getLogEcsFormattingDestinationDir()
      • getLogFileSize

        public long getLogFileSize()
      • isShipAgentLogs

        public boolean isShipAgentLogs()
      • getLogFormatFile

        public LogFormat getLogFormatFile()