...
Introduction
IzPack installers use Java Logging for logging any information. If you want to customize it you should be familar with it, otherwise there is a good description of its principles in Oracle's Java Logging Overview.
Without any explicit specification on the command line or in the install.xml itself, an installer logs to the console at the given log level. For this purpose it associates a default Java ConsoleHandler combined with a built-in formatter not being that messy like the JRE's SimpleFormatter. The log level to limit the output to depends on whether you set IzPack to debug mode by adding the command line option -debug (or the -DDEBUG=true
JVM option for IzPack versions < 5.1.0). If the installer runs in debug mode the Java Logging level for the root logger is set to FINE by default globally, by default it is INFO otherwise.
...
Beyond the built-in logging mechanisms for console and file output there can be override the Java Logging configuration, handlers, formatters and their configuration at each desired Java package hierarchy you may add to an external configuration file, which can be passed as JVM command line option (standard approach of the LogManager API) or at compile time in the installer descriptor.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<logging> <log-file pattern="${logging.file}" append="true" ... /> </logging> |
The <logging>
element accepts the following attributes:
Attribute name | Description | Allowed values | Default |
---|---|---|---|
level | Specifies the global logging level for console logging. The value |
| INFO |
The above definition of a <log-file>
supports all configuration options of java.util.logging.FileHandler as attributes, in particular:
Attribute name | Description | Allowed values | Default | ||
---|---|---|---|---|---|
| Pattern for generating the output file name.
| Valid path to log file name. The file name is normalized as much as possible. | %h/java%u.log | ||
level | Specifies the logging level. This level overrides the global level defined above. Example: If the global logging level is set to |
| INFO | ||
filter | Specifies the name of a Filter class to use (defaults to no Filter). | Fully qualified Java class name. | (no filter) | ||
encoding | The name of the character set encoding to use. | Valid Java character set name. Example: like UTF-8 | (platform encoding) | ||
limit | Specifies an approximate maximum amount to write (in bytes) to any one file. If this is zero, then there is no limit. | Integer value >= 0 | (no limit) | ||
count | Specifies how many output files to cycle through. This allows you to maintain a limited number of log file archives with a maximum size specified by the limit attribute (rolling log files). | Integer value >= 1 | 1 | ||
append | Specifies whether the FileHandler should append onto any existing files. | true | false | false | ||
mkdirs | Specifies whether the installer should recursively create the parent directory of the log file speciified by the
| true | false | false |
...
You can also log to files, sockets and other resources, see the appropriate handler implementation and their dedicated configuration for more details.
...