dibog / cloudwatch-logback-appender

AWS Cloudwatch Logs appender for logback
Apache License 2.0
25 stars 23 forks source link

No AWS logs when exception is thrown during web app deploy on Tomcat #22

Open amelumad opened 3 years ago

amelumad commented 3 years ago

I have a Tomcat web app that checks its configuration integrity in a listener. If an issue is found it throws an exception and the deploy is aborted. This exception is logged just fine in a log file in Tomcat's directory on disk but for some reason it does not appear in AWS stream. Once the app is deployed the logs do get through to AWS.

In other words the first logger does work in the above scenario whilst the second one doesn't.

<logger name="com.voxme.webam" level="INFO" additivity="false">
    <appender-ref ref="STDOUT"/>
    <appender-ref ref="INFO_FILE"/>
    <!--<appender-ref ref="DEBUG_FILE"/>-->
    <appender-ref ref="ERROR_FILE"/>
</logger>

<logger name="com.voxme.webam" level="ERROR" additivity="false">
    <appender-ref ref="CLOUDWATCH"/>
</logger>

logback.zip