This document describes how to change the location of log files for the server and controller for a Cisco Energy Management (CEM) installation.
CEM writes a lot of useful information to several log files. Unfortunately, the product does not have a built-in option to configure the location of the log files generated by the services related.
For maintenance/control reasons but also for usability, it could be required to move the CEM logs to another location.
There are no specific requirements for this document.
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Each component in the CEM installation has a slightly different way to move the log files.
For the instructions, you start from the default log file location: C:\Program Files\Cisco Energy Management Controller\logs and will move the log files to E:\CEM_logs.
Adjust these paths to match your CEM installation and preferred log location.
Edit C:\Program Files\Cisco Energy Management Controller\service\settings.json
Change: "logDir": "C:\\Program Files\\Cisco Energy Management Controller\\logs" To: "logDir": "E:\\CEM_logs"
Edit C:\Program Files\Cisco Energy Management Controller\bin\CiscoEnergyManagementControllerWatcher.xml Change: <logDir>C:\Program Files\Cisco Energy Management Controller\bin\\..\logs\</logDir> To: <logDir>E:\CEM_logs\</logDir>
Server and Processor
Edit C:\Program Files\Cisco Energy Management\bin\CiscoEnergyManagementServer.xml Change: <environmentVars>JAVA_HOME=..\JRE;PLAY_LOG_PATH=..\logs;PATH=.\tableau</environmentVars> To: <environmentVars>JAVA_HOME=..\JRE;PLAY_LOG_PATH=E:\CEM_logs;PATH=.\tableau</environmentVars>
Edit both these files:
C:\Program Files\Cisco Energy Management\WebApp\conf\log4j.properties C:\Program Files\Cisco Energy Management\WebApp\conf\log4jprocessing.properties
Change: log4j.appender.playrolling.File = C:\\Program Files\\Cisco Energy Management\\logs\\Server.log To: log4j.appender.playrolling.File = E:\\CEM_logs\\Server.log
Change: log4j.appender.processorrolling.File = C:\\Program Files\\Cisco Energy Management\\logs\\Processor.log To: log4j.appender.processorrolling.File = E:\\CEM_logs\\Processor.log
After the changes, the files ServerService.log and ProcessorService.log will still be written in the default log directory (these files are rather small).
The location of the logfiles can be changed in C:\Program Files\Cisco Energy Management\bin\CiscoEnergyManagementServer.xml or CiscoEnergyManagementProcessor.xml but the <logFileName> parameter only accepts locations relative to the original logging directory.
Edit C:\Program Files\Cisco Energy Management\bin\CiscoEnergyManagementSystemWatcher.xml Change: <logDir>C:\Program Files\Cisco Energy Management\bin\\..\logs\</logDir> To: <logDir>E:\CEM_logs\</logDir>
Edit C:\Program Files\Cisco Energy Management\pgsql\data\postgresql.conf Add: log_directory = 'E:\CEM_logs'
Edit C:\Program Files\Cisco Energy Management\apache\conf\httpd.conf Change: ErrorLog "C:/Program Files/Cisco Energy Management/logs/apache_error.log" To: ErrorLog "E:/CEM_logs/apache_error.log"
Change: CustomLog "C:/Program Files/Cisco Energy Management/logs/apache_access.log" common To: CustomLog "E:/CEM_logs/apache_access.log" common
(this change appears twice in httpd.conf)
Change: DOSLogDir "C:/Program Files/Cisco Energy Management/logs" To: DOSLogDir "E:/CEM_logs"