- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Created on 06-06-2018 09:35 PM - edited 09-16-2022 01:43 AM
OBJECTIVE:
Updating the log configs of DPS App. Example default log file is set to logs/application.log which can be changed or Updating the log level to DEBUG for troubleshooting. Since DP App will be running in docker we can use docker commands to update them.
STEPS:
1. Find the docker container running DP App on the host running DPS. Use "docker ps"
[root@dps-node ~]#docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES abd412417907 hortonworks/dlm-app:1.1.0.0-41 "runsvdir /etc/sv" 28 hours ago Up 2 hours 9011/tcp dlm-app 62620e578e31 hortonworks/dp-app:1.1.0.0-390 "/bootstrap.sh" 2 days ago Up 16 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 9000/tcp dp-app 38dda17dfdf4 hortonworks/dp-cluster-service:1.1.0.0-390 "./docker_service_st…" 2 days ago Up 2 days 9009-9010/tcp
Copy the container ID, from above example it is "62620e578e31"
2. Get the current logback.xml file
[root@dps-node ~]# docker exec -it 62620e578e31 /bin/cat /usr/dp-app/conf/logback.xml > logback.xml
3. Update the configs in local logback.xml which we redirected in above command. In below I have updated the location from default logs/application.logs to /usr/dp-app/logs/.
<configuration> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>/usr/dp-app/logs/application.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- Daily rollover with compression --> . . <appender name="AKKA" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>/usr/dp-app/logs/akka.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> . . . </encoder> </appender> <appender name="ACCESS_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>/usr/dp-app/logs/access.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> . .
We can also update the log level .
<root level="DEBUG"> <appender-ref ref="FILE"/> </root>
4. If needed make a backup of the original logback.xml file and cp the updated logback.xml
[root@dps-node ~]#docker exec -it 62620e578e31 /bin/cp /usr/dp-app/conf/logback.xml /usr/dp-app/conf/logback.xml.bck
[root@dps-node ~]# docker exec -i 62620e578e31 tee /usr/dp-app/conf/logback.xml < logback.xml
5. Restart the docker container is required to make changes effective.
[root@dps-node ~]# docker restart 62620e578e31
6. You can verify if the changes have updated.
[root@dps-node ~]# docker exec -it 62620e578e31 /bin/ls -lrt /usr/dp-app/logs total 64 -rw-r--r-- 1 root root 0 Jun 6 20:50 access.log -rw-r--r-- 1 root root 62790 Jun 6 21:27 application.log