sequenceiq / cloudbreak-shell

CLI shell for the Cloudbreak project
https://cloudbreak.sequenceiq.com/
16 stars 6 forks source link

add timestamp to cbshell log file #104

Closed desaiak closed 9 years ago

desaiak commented 9 years ago

Is it possible to add timestamp to cbshell log file? Currently its difficult to find logs based on time.

lalyos commented 9 years ago

Hi @desaiak you can modify the logging configuration as you wish.

For example starting cloudbreak shell as:

java -Dlogging.config=file://logback.xml -jar build/libs/cloudbreak-shell-0.5.DEV.jar --sequenceiq.user=admin@example.com

You can give a customized config file. For example you can add timestamp by:

<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">
  <appender name="FILE" class="ch.qos.logback.core.FileAppender">
    <file>cloudbreak-shell.log</file>
    <append>true</append>
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} %-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
    </encoder>
  </appender>

    <root level="DEBUG">
        <appender-ref ref="FILE"/>
    </root>
</configuration>

with DEBUG level you can actually see the network wire traffic as well. Sou you can debug the communication between ambari-shell and the ambari-server