Skip to content

Commit

Permalink
Save log file as github artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
mdemare committed Sep 18, 2024
1 parent 4d90dd5 commit 6437286
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ jobs:
TRUSTSTORE: truststore.jks
TRUSTSTORE_PASSWORD: ${{ secrets.TRUSTSTORE_PASSWORD }}
run: lein test :e2e

- name: Upload log file
uses: actions/upload-artifact@v3
with:
name: test.log
path: logs/test.log
2 changes: 2 additions & 0 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
;; i.e. cider-nrepl and refactor-nrepl generally have
;; conflicting transitive dependencies.
:test {:pedantic? :abort
:jvm-opts ["-Dlogback.statusListenerClass=ch.qos.logback.core.status.OnConsoleStatusListener"
"-Dlogback.configurationFile=./test/resources/logback.xml"]
:dependencies [[pjstadig/humane-test-output "RELEASE"]]
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]}
Expand Down
2 changes: 1 addition & 1 deletion resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<configuration>
<!--
This is the development logging configuration and won't be on
This is the test logging configuration and won't be on
the classpath when running in production.
For prod or other use cases, set the path to an alternative
Expand Down
40 changes: 40 additions & 0 deletions test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<configuration>
<!--
This is the test logging configuration and won't be on
the classpath when running in production.
For prod or other use cases, set the path to an alternative
config using
java -Dlogback.configurationFile=/path/to/config.xml ...
See https://logback.qos.ch/manual/configuration.html
-->
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/test.log</file>

<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.contrib.json.classic.JsonLayout">
<timestampFormat>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</timestampFormat>
<timestampFormatTimezoneId>UTC</timestampFormatTimezoneId>
<appendLineSeparator>true</appendLineSeparator>
<jsonFormatter class="ch.qos.logback.contrib.jackson.JacksonJsonFormatter">
<prettyPrint>false</prettyPrint>
</jsonFormatter>
</layout>
</encoder>
</appender>

<logger name="ch.qos.logback" level="WARN" />
<logger name="org.eclipse.jetty" level="INFO" />
<logger name="org.eclipse.jetty.server" level="WARN" />
<logger name="org.eclipse.jetty.util.log" level="WARN" />
<logger name="com.baeldung.httpclient.readresponsebodystring" level="DEBUG"/>
<logger name="org.apache.http" level="DEBUG"/>
<logger name="org.apache.hc.client5.http" level="DEBUG"/>
<logger name="org.apache.xml.security" level="INFO" />
<logger name="nl.surf.eduhub-rio-mapper.http-utils" level="TRACE" />
<root level="debug">
<appender-ref ref="FILE" />
</root>
</configuration>

0 comments on commit 6437286

Please sign in to comment.