Chapter 17. Logging
Main Logs |
Another Useful Logging Settings |
Access Log in Apache Tomcat |
Application Server Logs |
Graph Run Logs |
Server Audit Logs |
Designer-Server Integration Logs |
Main Logs
Since 5.2, CloverDX Server uses the Log4j 2 library for logging. The WAR file contains the default Log4j 2 configuration.
Location of the Log4j 2 configuration file is:
Server Core:
[clover.war]/WEB-INF/log4j2.xml
Worker:
[clover.war]/WEB-INF/worker/cloveretl.server.worker.jar/log4j2.xml
By default, log files are produced in the directory specified by
the java.io.tmpdir
system property in the cloverlogs
subdirectory.
The java.io.tmpdir
system property usually points to a common system temp directory, i.e. /tmp
.
On Apache Tomcat, it is usually the $TOMCAT_HOME/temp
directory.
You can override the default logging configuration (log4j2.xml
bundled in the clover.war
)
with another Log4j 2 configuration file (in this case, only the properties from the new file are used):
Server Core:
Define a new web application context parameter
log4jConfiguration
with the full path to the file. For example, in the case of Apache Tomcat, create/update the Context configuration file and add the following line:<Parameter name="log4jConfiguration" value="file:///C:/path/to/log4j2-server.xml" />
Restart CloverDX Server.
Worker:
Define a new system property (e.g. using Worker's JVM Arguments field)
log4j.configurationFile
with the full path to the file:-Dlog4j.configurationFile=file:///C:/path/to/log4j2-worker.xml
Restart Worker.
Tip | |
---|---|
It is better to copy the original file and modify the copy, than to create a new file. If you used a custom Log4j configuration in CloverDX Server 5.1 and older, you will have to migrate to Log4j 2 configuration in CloverDX Server 5.2. For configuration details, see Configuration of Log4j 2. |
Note:since such a configuration overrides the default configuration, it may influence Graph run logs. So your own log configuration has to contain following fragment to preserve Graph run logs:
<logger name="Tracking" additivity="false"> <level value="debug"/> </logger>
Another Useful Logging Settings
These system properties allow for logging of HTTP requests/responses to stdout:
Client side:
com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
(For more information, see the
Integrating CloverDX Designer with CloverDX Server chapter of the CloverDX Designer User's Guide.)
Server side:
com.sun.xml.ws.transport.http.HttpAdapter.dump=true
Access Log in Apache Tomcat
If you need to log all requests processed by the server,
add the following code to $CATALINA_HOME/conf/server.xml
.
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t %D %r %s %b" />
The format defined above has following meaning
[IP address] [date-time] [processing duration in milliseconds] [method] [URL] [protocol+version] [response code] [response size]
The log will look like the next line
172.17.30.243 - - [13/Nov/2014:12:53:03 +0000] 2 "POST /clover/spring-rpc/clusterNodeApi HTTP/1.1" 200 1435"
See also Valve in documentation on Apache Tomcat.
Application Server Logs
If you use Apache Tomcat, it logs into $CATALINA_HOME/logs/catalina.out
file.
Graph Run Logs
Each graph or jobflow run has its own log file – for example, in the Server Console, section Execution History.
By default, these log files are saved in the subdirectory cloverLogs/graph
in the directory specified by java.io.tmpdir
system property.
It’s possible to specify a different location for these logs with the CloverDX graph.logs_path
property.
This property does not influence main Server logs.
Server Audit Logs
Server Audit Log logs operations called on ServerFacade and JDBC proxy interfaces.
Audit logging can be enabled by setting (adding) the value of CloverDX property
logging.logger.server_audit.enabled
to true.
In server GUI, you can change the property value in
→ → .
Audit logging is disabled by default.
The name of output file is server-audit.log
.
The file is in the same directory as main server log files.
Default log level is DEBUG, so all operations which may do any change or another important operations (e.g. login or openJdbcConnection) are logged.
To enable logging of all operations, change log level to TRACE in the log4j configuration.
Each logged operation is logged by two messages: entering method and exiting method (if the exception is raised, it's logged instead of output parameters)
- Entering method (marked as "inputParams"). All method's parameters (except for passwords) are printed.
- Exiting method (marked as "outputParams"). Method's return value is printed.
- Exception in method (marked as "EXCEPTION"). Exception's stacktrace is printed.
Message also contains:
- username, if the user is known
- client IP address, if it's known
- cluster node ID
- Interface name and the operation name
Values of transient and lazy initialized (in entity classes) fields and fields with binary content are not printed.
Designer-Server Integration Logs
The logging of Designer-Server integration can be enabled with logging.logger.server_integration.enabled configuration property.
The name of the log file is server-integration.log
.
The log format is date and time, IP address of Designer, user name, operation, result of the operation (success/failure) and duration in milliseconds.
2018-03-07 16:42:00,525 10.0.3.2 user=clover, operation=executeGraph SUCCESS duration=576 ms