The following table describes the logging elements that you need to configure in the settings.xml file for XPS to integrate with N4. If you omit this element, a standard "managed" logger is used to log all primary XPS log output. If you supply this element, it completely defines the logging environment.
The logging element consists of logger elements which are defined and written to the appender element. This allows you to have different log levels for different output and keep them in the same output file.
The default logging configuration corresponds to the following XML:
<logging>
<appender name="main" kind="managed" prefix="xps" />
<logger name="default" level="60" appender="main" />
<logger name="messages" level="80" appender="main" />
</logging>
The appender describes where the output is written to physically. For example, it can write to the console, to a file, or to a set of rolling files. If no appender is defined, the default is to write to the console.
Appender Elements in settings.xml
Element |
Description |
Values |
Example Section |
---|---|---|---|
name |
The name of the appender which the "<logger>" tag can refer to. |
Any text. |
<appender name="main" kind="managed" prefix="xps" />
|
kind |
The type of appender. |
|
|
prefix |
The prefix for the log file names. |
Any text. The default is "xps". |
|
dir |
The subdirectory where files are written. |
Any directory. The default is "log". |
|
linelimit |
The file size limit in number of log statements (not counting stack trace lines). |
Integer. The default is 10000. |
|
lifedays |
The number of days a managed appender's closed old log file will remain on disk before being deleted. |
Integer. The default is 30. |
The logger element provides one or more logger definitions inside the <logging> element. For N4, you need to define at least the default logger.
Logger Elements in settings.xml
Element |
Description |
Values |
Example Section |
---|---|---|---|
name |
The unique name of the logger. XPS logs output to loggers by name, so by using particular names you can route certain log output to a given logger. If XPS logs to a named logger that does not exist, the output goes to the default logger (name = "default", or the first logger if there is none named "default").
|
Some named loggers where XPS logs to:
|
Example of writing to multiple appenders: <logging> <appender name="myfile" kind="file" path="myoutput.log" /> <appender name="console" kind="cout" /> <logger name="default" level="60"> <appender name="myfile" /> <appender name="console" /> </logger> </logging>
|
level |
The logging level used for any loggers you define here and for which you do not specify the log level. |
Possible values are 0-100, where the following numeric values have common meanings:
|
|
appender |
The name of the appender to write output to. If this is omitted, it writes to the default appender. |
Name of the appender. |