What is the log4j.xml file?
The log4j.xml file is a critical configuration file containing information necessary for Cerberus to implement logging.
Where can I find these configuration files?
Locate the log4j.xml file at: C:\ProgramData\Cerberus LLC\Cerberus FTP Server\
What do I need to modify?
-
1. Open the log4j.xml file in your preferred file editor.
-
2. Replace the following line (there might be multiple lines depending on your configuration):
<param name="ConversionPattern" value="[%d{yyyy-MM-dd HH:mm:ss}]:%7.7p [%6.6x] - %m%n" />
With
<param name="ConversionPattern" value="[%d{yyyy-MM-dd HH:mm:ss}]:%7.7p [%6.6x] - [%X{client.ip}]:%X{client.user} - %m%n" />
3. Save your changes.
In the example, %X{client.ip}, %X{client.user}, and %X{client.session} are custom parameters providing the IP address, username, and session ID, respectively. Including these details in the logs enhances visibility and comprehension.
After modifying the file:
Restart the Cerberus FTP Server Service in the Windows System Manager. Each log statement originating from a client connection will now include a username and an IP address.
Example:
[2019-11-18 10:53:11]: INFO [1994] - [127.0.0.1]:dana - File upload started……
What happens if I don’t modify my log4j.xml file?
Cerberus will continue logging all file and user operations. However, events beyond connection establishment or successful authentication will lack username and IP information.
Note: For new installations from version 11.0 and above, this feature is automatically enabled for on-screen and default file-based logging.
Comments
0 comments
Article is closed for comments.