Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add raw logs from gateway in a file #473

Closed
jkandasa opened this issue Oct 9, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@jkandasa
Copy link
Member

commented Oct 9, 2018

add raw logs from the gateway in a file. will be used for debugging purpose

@jkandasa jkandasa self-assigned this Oct 9, 2018

@jkandasa jkandasa added this to the 1.4.0 milestone Oct 9, 2018

jkandasa added a commit that referenced this issue Oct 9, 2018

@jkandasa jkandasa closed this Oct 9, 2018

@jkandasa

This comment has been minimized.

Copy link
Member Author

commented Oct 30, 2018

enable raw message debugging in mycontroller/conf/logback.xml, by default this logger will be in INFO mode. change it to level="DEBUG"

  <logger name="RAW_MESSAGE_LOGGER" level="DEBUG" additivity="false">
    <appender-ref ref="GATEWAY_RAW_MESSAGE_APPENDER" />
  </logger>

  <appender name="GATEWAY_RAW_MESSAGE_APPENDER" class="ch.qos.logback.classic.sift.SiftingAppender">
    <discriminator>
      <key>gateway_reference</key>
      <defaultValue>0_default</defaultValue>
    </discriminator>
    <sift>
      <appender name="fileAppender" class="ch.qos.logback.core.FileAppender">
        <file>../logs/raw_message_gw_${gateway_reference}.log</file>
        <encoder>
          <pattern>%date %replace(%replace(%msg){'\r', '\\r'}){'\n', '\\n'}%n</pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
          <FileNamePattern>../logs/raw_message_gw_${gateway_reference}%i.log.zip</FileNamePattern>
          <MinIndex>1</MinIndex>
          <MaxIndex>5</MaxIndex>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
          <MaxFileSize>5MB</MaxFileSize>
        </triggeringPolicy>
      </appender>
    </sift>
  </appender>

Actual file: https://github.com/mycontroller-org/mycontroller/blob/development/dist/src/main/package/conf/logback.xml
You will get debug logs on mycontroller/logs/raw_message_gw_*.log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.