Externalize log4j.properties in Windows
Was this helpful?
This article describes the steps to externalize the log4j.properties file for the OvalEdge application deployed on Apache Tomcat in a Windows environment. Externalizing the logging configuration enables updates to log levels, appenders, and file locations without redeploying the application. This approach supports easier maintenance and environment-specific configurations.
Ensure the following conditions are met before proceeding:
Access to the Windows server hosting the OvalEdge application
Administrative permissions to modify Apache Tomcat configuration and restart services
Apache Tomcat installation (for example: C:\ovaledge\apache-tomcat-10.1.40)
Java runtime installed and configured
Text editor (for example: Notepad++, VS Code, or Notepad)
Access the Application Server
Access the Windows server using Remote Desktop Protocol (RDP) or console access.
Sample Reference Screenshot

Create External Configuration Directory and Copy File
Open Command Prompt or PowerShell with administrative privileges.
Create the external configuration directory:
mkdir C:\ovaledge\extpropSample Reference Screenshot

Place the log4j.properties file in the following directory:
C:\ovaledge\extprop\log4j.propertiesSample Reference Screenshot

Modify the External log4j.properties File
Open the file:
C:\ovaledge\extprop\log4j.propertiesUpdate logging properties based on requirements. Example:
#log4j.rootLogger=INFO, CONSOLE
log4j.rootLogger=INFO, FILESample Reference Screenshot

Configure Tomcat to Use External log4j.properties
Navigate to the Tomcat bin directory:
C:\ovaledge\apache-tomcat-10.1.40\binOpen the Tomcat service configuration from this directory. Sample Reference Screenshot

In the Java tab, add the following parameter under Java Options:
-Dlog4j.configuration=file:C:\path\to\extprop\log4j.properties
Sample Reference Screenshot

Restart Apache Tomcat
Restart Apache Tomcat to apply the configuration changes.
If running as a Windows service, restart using Services (services.msc) or command-line tools. Sample Reference Screenshot

Copyright © 2026, OvalEdge LLC, Peachtree Corners, GA, USA.
Was this helpful?
Was this helpful?

