Logging
You can capture and manage Chromium and Equo Chromium logs using Java Util Logging (JUL). This means you can control how logs are formatted, where they are printed to, and which severity level will be used to filter them; among many other configuration options available.
Enable logging
To enable logging, set this system property when launching your Java application:
-Dchromium.debug=true
This feature is available starting from version 128.0.12 and also in 116.0.29 . In other versions, setting the chromium.debug system property causes logs to be handled internally by Equo Chromium and printed only to the console, without Java Util Logging support.
|
Configuring Java Util Logging
You can configure Java Util Logging by:
-
Setting a
JUL configuration file
-
Setting a
JUL configuration class
-
Programmatically configure your loggers in Java
Configuring JUL via a configuration file or class
To configure JUL by setting a configuration file or class, you must set one of the following system properties before creating any browser instance:
-Djava.util.logging.config.file=/path/to/your/custom-logging.properties
-Djava.util.logging.config.class=path/to/your/custom-logging.ConfigClass
Redirecting output to a file
To save Chromium and Equo Chromium logs to a file, set and configure a FileHandler in your logging configuration.
In a .properties
file:
handlers=java.util.logging.FileHandler java.util.logging.FileHandler.pattern=<PATH_TO_LOG_FILE>/<LOG_FILE_NAME>.log
Use a relative or absolute path for the log file.
The format of the logfile path specified in
|
Formatting the logs
You can also configure how logs are formatted and what information they include by using or customizing the formatter class. Available formatters include SimpleFormatter
and XMLFormatter
, each providing a distinct log output style. By default, the formatter used (as defined in the default logging.properties
of the JDK) is the XMLFormatter
.
In your configuration file:
java.util.logging.<YOUR_HANDLER>.formatter=java.util.logging.SimpleFormatter
SimpleFormatter
:
Jun 25, 2025 1:13:08 PM com.equo.chromium.swt.Log log
FINE: Logging format example!
XMLFormatter
:
<record>
<date>2025-06-25T16:14:53.469160405Z</date>
<millis>1750868093469</millis>
<nanos>160405</nanos>
<sequence>1</sequence>
<level>FINE</level>
<class>com.equo.chromium.swt.Log</class>
<method>log</method>
<thread>1</thread>
<message>Logging format example!</message>
<param>-1</param>
</record>
You can also customize the SimpleFormatter
class to define a custom format for your logs. To do this, you just override and modify the .format
attribute of the java.util.logging.SimpleFormatter
class (programmatically, this would mean overriding the format()
method of the same class with a custom implementation).
In your configuration file:
java.util.logging.SimpleFormatter.format=%1$tF %1$tT [%4$s] %5$s%n
This would format the logs like this:
2025-06-25 13:53:02 [FINE] Logging format example!
There are also several configuration options for the formatting of your log file’s name, as well as for the size limit, maximum amount of log files, whether logs will be appended to one single log file or have their own file each, and many others, all listed in the Java Util Logging Documentation. |
By default, the Equo Chromium logs will be of level FINE
, which is similar to a "debugging" level.