The Foglight Management Server (FMS) and Foglight Agent Manager (FglAM) has numerous settings that can be configured to specify the information written to log files and the quantity of log files stored on the server.
These are found in the log.config file located in the config folder of the FMS and FglAM.
If you would like log messages in a different language to the default set by the system, change this setting. The value must use one of the following formats:
Locale = "en_CA";
|CONSOLE||Outputs to the console in which the application was started|
|FILE||Outputs to a formatted text file|
|SERIALIZED_FILE||Outputs to a serialized object file|
Agents normally have CONSOLE and FILE active.
The SERIALIZED_FILE target is active in all FglAM applications, but as described in the table below, its threshold is set to OFF normally. This can be overridden in release-mode by setting its threshold to something other than OFF, preferably ALL.
Each target has a set of properties that can be set to modify its behaviour.
All targets have one common property:
String. The threshold log level for the target. Log messages of a level below this threshold are ignored by the target. Standard levels are ALL, DEBUG, VERBOSE, INFO, WARN, ERROR, FATAL and OFF, in descending order of verbosity. The defaults are as follows:
The FILE and SERIALIZED_FILE log targets have the following additional properties:
Boolean. Whether to compress old log files using the gzip method when the maximum log file size has been reached and a new one is opened. Defaults to false.
String. The directory in which log files are created. Relative paths are resolved from the current state directory. The directory and all its parent directories are created if they don't exist. When using Windows-style backslash path separators, they must be escaped. For example, "C:\\Quest\\logs". Defaults to the "logs". subdirectory of the Quest default state directory.
Integer. How many old log files to retain when the maximum log file size has been reached and a new one is opened. 1 means infinite. Defaults to 50.
Long. The maximum size of a log file before it is closed and a new one is opened. The size is checked after each log message is written, so the actual size may exceed the maximum slightly. 0 means infinite. Defaults to (20000000) = 20MB.
And the FILE log target has an additional property:
String. The character set in which to write to the file. Defaults to "UTF-8".
CONSOLE and FILE are "formatting" log targets -- they apply a format pattern to the log message before writing it out. Each of these log targets has a default formatter: CONSOLE uses WrappingLogMessageFormatter which is based on DefaultLogMessageFormatter and wraps the formatted log message to a right margin and optionally indents the subsequently wrapped lines. FILE uses DefaultLogMessageFormatter.
The formatter is controlled using the "formatter" subset of properties. The "formatter.class" property sets the class name for a new instance of a formatter that will be created and assigned to that log target before applying the remaining properties. If the "formatter.class" property is not present, the remaining properties are applied to the existing formatter.
The com.quest.common.log.DefaultLogMessageFormatter has the following properties:
Boolean. Does not include implementation details: thread name, category class and exception stacktrace.
Boolean. Does not include the timestamp. Used by log targets which have their own timestamping mechanism, for example, NATIVE.
The com.quest.common.log.WrappingLogMessageFormatter has the following properties:
Integer. The maximum number of characters per line.
Target.CONSOLE.formatter.columns = 120;
Target.FILE.directory = "/var/logs/glue";
The "logs" directory is resolved relative to the current state directory. So "." would resolve to /state/default (if "default" is the current state location as set by the --location/-l command line option).
Including thread names and class names in the console output is more information than is needed. Thread and class names will still be included in the log file(s). We still include the timestamp in the console log.
max 3 backups, -1 == infinite.
The set count is the number of log collections kept between runs. In the default configuration, there will be up to the configured sets of logs, each containing up to the rollover count of log files.
The rollover Count specifies that when the first log file (_001) fills up it is compressed and a new log (_002) is started. This continues until Target.FILE.maxRolloverCount old log files are present (specified in log.config). The the oldest compressed log is deleted.
Note: There is a special case The first log file _001 is never deleted as it always contains useful diagnostic information. It is not included in the rollover count.
Compress on rollover specifies that when a log file reached the max file size the file is then compressed as a .gz file and the original .log file is deleted.
These settings state that FglAM will retain up to 10 log files from each run/execution. Once the log count exceeds this value it will start to remove the oldest ones (while retaining the first log file).
These settings set a 10 meg max file size (in bytes), 0 == infinite