Configuring binary logging in Liberty
Use this information as a guide for configuring binary logging in your Liberty.
About this task
A server configuration consists of a bootstrap.properties file, a server.xml file, and any (optional) files that are included with those files. The bootstrap.properties file specifies properties that need to be available before the main configuration is processed, and are kept to a minimum. The server.xml file is the primary configuration file for the server.
The server.xml file and its associated files use a simple xml format that is suitable for most text editors. A richer editing experience is provided by the Eclipse server adapter for Liberty (WAS4D+ adapter), which uses a generated schema to provide drop-down lists of available choices, auto-completion, and other editing tools. For a description of the Eclipse server adapter for Liberty, see Editing the Liberty configuration by using developer tools.
The bootstrap.properties file specifies whether the server uses binary logging as the log and trace framework, or the default log and trace framework. A server restart is required to switch between binary logging and the default log and trace framework.
- Server configuration: To get logging from your own code, which is loaded after server configuration processing, use the server configuration to configure binary logging.
- bootstrap.properties file: You might need to set logging properties to take effect before the server configuration files are processed. For example, if you need to analyze problems that occur early in server start or configuration processing. In this case, you can configure binary logging in the bootstrap.properties file.
You can set Logging properties in either the bootstrap.properties or the server.xml file. Use attributes in the server.xml file, or use equivalent properties in the bootstrap.properties file. Any settings in the bootstrap.properties file are used from the time the server reads the bootstrap.properties file until the time the server.xml file is processed. If the logging properties in the bootstrap.properties file are not replaced or reset in the server.xml file, the property values in the bootstrap.properties file continue to be used.
When binary logging is enabled, the maxFileSize, maxFiles, messageFileName, traceFileName, and traceFormat logging element attributes are ignored (since binary logging runs without trace.log and messages.log files). The traceSpecification, consoleLogLevel, logDirectory, and hideMessage attributes continue to be used to set the trace specification, the level for the console log, the placement of the log and trace files, and the configuration for the messages that you want to hide from the console.log file
If you set logging or binary logging attributes in the server.xml file, you can avoid changes in configuration between startup time and runtime by setting the corresponding properties in the bootstrap.properties file to the same value. If no logging or binary logging properties are set in the bootstrap.properties file, the server uses the default logging settings.