Skip to main content

Config.Logging

persistent class Config.Logging extends %Library.Persistent, Config.CommonSingleMethods, Config.CommonProperties, %SYSTEM.Help [ Final ]

SQL Table Name: Config.Logging

This is the API for setting and getting the configuration values for the log daemon. Use this class to set and get the configuration values for the log daemon. See SYS.LogDmn for the top level API for starts and stops the daemon.

Property Inventory

Method Inventory

Properties

property ChildProcessArgs as %String;
Arguments with which the irislogd binary will be run at startup. When populated, takes precedence over the deprecated ChildProcessLaunchCommand.
Property methods: ChildProcessArgsDisplayToLogical(), ChildProcessArgsGet(), ChildProcessArgsGetStored(), ChildProcessArgsLogicalToDisplay(), ChildProcessArgsLogicalToOdbc(), ChildProcessArgsNormalize(), ChildProcessArgsSet()
deprecated property ChildProcessLaunchCommand as %String [ InitialExpression = $$$LogDaemonBinaryFile _ " " _ $$$LogDaemonDefaultArgs ];
Deprecated: Use ChildProcessArgs. When ChildProcessArgs is non-empty, it takes precedence over this property: the log daemon will launch the irislogd binary as its child process with the specified arguments. This is the command the parent log daemon will use to invoke the daemon child process on start up. Everytime the parent log daemon scans the messages.log and %SYS.Audit database, it will send the new messages found in these places to the child process's stdin. While this child process could be the demo executable we provide
/bin/irislogd
, it can technically be any executable so long as that executable is daemon (so it runs as long as the log daemon) and listens to its standard in.
Property methods: ChildProcessLaunchCommandDisplayToLogical(), ChildProcessLaunchCommandGet(), ChildProcessLaunchCommandGetStored(), ChildProcessLaunchCommandLogicalToDisplay(), ChildProcessLaunchCommandLogicalToOdbc(), ChildProcessLaunchCommandNormalize(), ChildProcessLaunchCommandSet()
property Enabled as %Boolean [ InitialExpression = 0 ];
Property is 1 (true) if the logging daemon is enabled. If property is 0 (false), any attempt to start the daemon will fail. Setting Enabled to 1 will NOT start the daemon. To start the daemon that, invoke ##class(SYS.LogDmn).Start() after setting this property equal to 1.
Property methods: EnabledDisplayToLogical(), EnabledGet(), EnabledGetStored(), EnabledIsValid(), EnabledLogicalToDisplay(), EnabledLogicalToXSD(), EnabledNormalize(), EnabledSet(), EnabledXSDToLogical()
property EventFilter as %String;
The EventFilter property stores the event filtering rules as a string, where patterns define inclusion (+), exclusion (-), and default inclusion. The filter patterns use . as a hierarchical separator and * as a wildcard (only allowed at the end of patterns). Specific rules take precedence over wildcard rules. Unmatched events default to inclusion. Example: "-A.*,+A.B,A.E,-C.D" will exclude events matching A.* except for A.B and A.E and will exclude C.D
Property methods: EventFilterDisplayToLogical(), EventFilterGet(), EventFilterGetStored(), EventFilterLogicalToDisplay(), EventFilterLogicalToOdbc(), EventFilterNormalize(), EventFilterSet()
property Format as %String (VALUELIST = ",NVP,JSON") [ InitialExpression = "NVP" ];
This property determines the format of log entries. This property can currently take two values: "NVP" and "JSON" This property is not case sensitive. If Format="NVP", then entries will look like when="2023-10-17 19:25:16.190" pid=89734 level=INFO event=Audit.OSCommand text="Execute O/S command" ... If Format="JSON" then entries will look like { "when": "2023-10-17 18:47:26.244", "pid": "89317" }
Property methods: FormatCompute(), FormatDisplayToLogical(), FormatGet(), FormatGetStored(), FormatIsValid(), FormatLogicalToDisplay(), FormatLogicalToOdbc(), FormatSQLCompute(), FormatSet(), FormatSetT()
property Interval as %Decimal (MAXVAL = 3600, MINVAL = "0.01") [ InitialExpression = 10 ];
The number of seconds the log daemon waits before scanning the messages.log file and %SYS.Audit log for new entries. If left empty, the default interval of 10s will be used. The messages.log file can be determined by calling ##class(Config.config).GetConsoleFileName() Interval may be expressed as a decimal up to two digit points (to the 10th of a millisecond) and can be no larger than 3600 (equivalent to 1 hour). For example, the following values of Interval are valid 0.10 - Wait 100 ms before rescanning for the messages.log and %SYS.Audit log for new entries 0.01 - Wait 10 ms before rescanning for the messages.log and %SYS.Audit log for new entries 1.5 - Wait 1.5 seconds before rescanning the messages.log and %SYS.Audit log for new entries 10 - Wait 10 seconds before rescanning the messages.log and %SYS.Audit log for new entries 3600 - Wait 3600 seconds (1 hour) before rescanning the messages.log and %SYS.Audit for new entries
Property methods: IntervalDisplayToLogical(), IntervalGet(), IntervalGetStored(), IntervalLogicalToDisplay(), IntervalNormalize(), IntervalSet(), IntervalXSDToLogical()
property Level as %String (VALUELIST = ",DEBUG2,DEBUG,INFO,WARN,SEVERE,FATAL") [ InitialExpression = "WARN" ];
This property sets the minimum level of message from the console.log that the logging daemon will emit. This property is case insensitive. For instance, if Level is "INFO", then the logging daemon will only emit messages from the console.log whose level is INFO, WARN, SEVERE, or FATAL. Set Level to be "FATAL" if you only wish the log daemon to be terse and only consider fatal errors, and set Level to be "DEBGUG2" if you wish the log daemon verbose and emit all messages from the messages.log and %SYS.Audit log
Property methods: LevelCompute(), LevelDisplayToLogical(), LevelGet(), LevelGetStored(), LevelIsValid(), LevelLogicalToDisplay(), LevelLogicalToOdbc(), LevelSQLCompute(), LevelSet(), LevelSetT()

Methods

classmethod ChildProcessArgsIsValid(value As %String) as %Status
Verifies the formatting of arguments passed to the child process spawned by the log daemon at startup time.

Available arguments:

  • -d - Emit diagnostic and error messages.
  • -e errfilename - Write errors and diagnostic messages to the given file.
  • -f logfilename - Write log messages to the given file.
  • -h hostname - Include the given host name in the structured log file.
  • -i irisinstance - Include the given instance name in the structured log file.
  • -s - Write log messages to the Unix syslog facility (Unix only).
classmethod ChildProcessLaunchCommandIsValid(value As %String) as %Status
classmethod FormatNormalize(value As %String(VALUELIST=",NVP,JSON")) as %String
classmethod IntervalIsValid(value As %Decimal(MAXVAL=3600, MINVAL=0.01)) as %Status
Ensure the bounds are respected for the Interval configuration setting
classmethod LevelNormalize(value As %String(VALUELIST=",DEBUG2,DEBUG,INFO,WARN,SEVERE,FATAL")) as %String
classmethod SetDefault() as %Status
This method sets the log daemon configuration options to their default values. You can find the default value for each configurable property by looking at the InitialExpression property keyword in this class (Config.Logging)

Indexes

index (CPFNameSectionHeaderName on CPFName,SectionHeader,Name) [IdKey, Type = key, Unique];
Index methods: CPFNameSectionHeaderNameCheck(), CPFNameSectionHeaderNameDelete(), CPFNameSectionHeaderNameExists(), CPFNameSectionHeaderNameOpen(), CPFNameSectionHeaderNameSQLCheckUnique(), CPFNameSectionHeaderNameSQLExists(), CPFNameSectionHeaderNameSQLFindPKeyByConstraint(), CPFNameSectionHeaderNameSQLFindRowIDByConstraint()

Inherited Members

Inherited Properties

Inherited Methods

Storage

Storage Model: Storage (Config.Logging)

^|"^^"_$ZU(12)|SYS("CONFIG")(ID)
=
%%CLASSNAME
ChildProcessLaunchCommand
Comments
Enabled
Format
Interval
Level
EventFilter
ChildProcessArgs
FeedbackOpens in a new tab