Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
wadoon committed Jun 15, 2024
1 parent 38e33af commit ccaa5ba
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions startkey.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

java -Dlogback.configurationFile=tools/logback.xml -jar tools/key-2.13.0-exe.jar
51 changes: 51 additions & 0 deletions tools/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<configuration>
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<timestamp key="timestamp" datePattern="yyyyMMdd'T'HHmmss"/>

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${user.home}/.key/logs/key_${timestamp}.log</file>
<append>false</append>
<encoder>
<charset>UTF-8</charset>
<!-- replace newlines by \n to allow line-based filtering (see LogView) -->
<pattern>%date|%level|%thread|%logger|%file:%line|%replace(%msg){'[\n\r]','\\n'}|%replace(%ex){'[\n\r]','\\n'}%nopex|%n</pattern>
<outputPatternAsHeader>true</outputPatternAsHeader>
</encoder>
</appender>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%date{HH:mm:ss.SSS}] %highlight(%-5level) %cyan(%logger{0}) - %msg%ex%n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
</appender>


<!-- Suppress certain classes for the end user -->
<logger name="de.uka.ilkd.key.nparser.builder.DeclarationBuilder" level="OFF"/>


<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
</root>

<!--
A logger for development, also print to CONSOLE. This logger is not restricted by any command line options.
You should not use this code on the master branch.
-->
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%relative] %highlight(%-5level) %cyan(%logger{0}): %msg %n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>TRACE</level>
</filter>
</appender>
<logger name="key.devel" level="DEBUG">
<appender-ref ref="STDERR"/>
</logger>

</configuration>

0 comments on commit ccaa5ba

Please sign in to comment.