Question
How to setup the detail level of your PTV xServer logging
Answer
This article explains how to adjust the logging level in PTV xServer 2 to control the amount of detail recorded in the logs. This is especially important in production environments to avoid excessive log file sizes and irrelevant information.
Logging Framework
PTV xServer uses the log4j2 framework for logging.
Available Log Levels
| Level | Description |
|---|---|
| DEBUG | Most detailed. Use only for diagnostics and debugging. |
| INFO | Suitable for evaluation and integration testing. |
| WARN | Highlights missing settings or parameters. |
| ERROR | Recommended default for production environments. |
How to Configure
For PTV xServer 1:
logRequests=fatal → Requests are only logged if the module crashes. This should be set to true.
logResponses=false → Responses are never logged. (Useful for clients who want to see detailed responses — but it generates a lot of logs and takes up space.)
Save the file and restart xServer to apply changes.
For PTV xServer 2:
Edit the file:conf/wrapper.conf
Ensure the following lines are set (or adjust as needed):
wrapper.console.loglevel=INFO
wrapper.logfile=%XSERVER2_LOG_DIRECTORY%/wrapper.log.YYYYMMDD
wrapper.logfile.format=LPTM
wrapper.logfile.loglevel=INFO
wrapper.logfile.rollmode=DATEFor more detailed logs, change INFO to DEBUG.
Save the file and restart xServer to apply changes.
Additional hints
On xServer 1:
By default, logging is not continuously active.
It’s configured at a minimal level, mainly for diagnosing critical errors.
If you want to count the number of requests sent (e.g., to /xlocate/ws/XLocate or /xroute/ws/XRoute etc., :
- Set logRequests=true
→ This will log all requests.
→ You can then count the lines in the log files.
→ Note: This can generate a large volume of logs in production, so post-processing (e.g., archiving or deleting logs after a certain number of requests) is recommended.
On xServer 2:
(Optional) Enable log rotation:
wrapper.logfile.maxsize=10m
wrapper.logfile.maxfiles=5