Skip to content

Commit

Permalink
Fixed blacklite (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsargent authored Nov 23, 2020
1 parent 1d4d473 commit eb4c7ec
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ libraryDependencies += "com.tersesystems.logback" % "logback-turbomarker" % ters
libraryDependencies += "com.tersesystems.logback" % "logback-honeycomb-appender" % terseLogback
libraryDependencies += "com.tersesystems.logback" %% "logback-honeycomb-playws" % terseLogback

libraryDependencies += "com.tersesystems.blacklite" % "blacklite-logback" % "0.1.1"

libraryDependencies += "com.tersesystems.blindsight" %% "blindsight-logstash" % "1.4.0-RC4"
36 changes: 36 additions & 0 deletions conf/blacklite-appender.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

<!--
~ SPDX-License-Identifier: CC0-1.0
~
~ Copyright 2020 Will Sargent.
~
~ Licensed under the CC0 Public Domain Dedication;
~ You may obtain a copy of the License at
~
~ http://creativecommons.org/publicdomain/zero/1.0/
~
-->

<included>

<appender name="BLACKLITE" class="com.tersesystems.blacklite.logback.BlackliteAppender">
<url>${blacklite.url}</url>

<archiver class="com.tersesystems.blacklite.archive.DefaultArchiver">
<file>${blacklite.archive.file}</file>
<archiveAfterRows>${blacklite.archive.after}</archiveAfterRows>

<rollingStrategy class="com.tersesystems.blacklite.logback.TimeBasedRollingStrategy">
<fileNamePattern>${blacklite.archive.pattern}</fileNamePattern>
<maxHistory>${blacklite.archive.history}</maxHistory>
</rollingStrategy>

<triggeringPolicy class="com.tersesystems.blacklite.archive.ArchiveRowsTriggeringPolicy">
<maximumNumRows>${blacklite.archive.max}</maximumNumRows>
</triggeringPolicy>
</archiver>

<include resource="json-encoder.xml"/>
</appender>

</included>
11 changes: 11 additions & 0 deletions conf/logback-reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ local {
append = false
immediateFlush = true
}

blacklite {
url = ${log.dir}"/blacklite.db"
archive {
file = ${log.dir}"/archive.db"
after = 10000
pattern = ${log.dir}"/archive.%d{yyyy-MM-dd-hh-mm.SSS}.db"
max = 500000
history = 20
}
}
}

# Defines properties (Strings) to be set in context scope (loggerContext.putProperty)
Expand Down
2 changes: 2 additions & 0 deletions conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<include resource="jsonfile-appender.xml"/>
<include resource="textfile-appender.xml"/>
<include resource="honeycomb-appender.xml"/>
<include resource="blacklite-appender.xml"/>

<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
<Name>TRACER_FILTER</Name>
Expand All @@ -34,6 +35,7 @@
<appender-ref ref="TEXTFILE"/>
<appender-ref ref="JSONFILE"/>
<appender-ref ref="HONEYCOMB"/>
<appender-ref ref="BLACKLITE"/>
</appender>
</appender>
</root>
Expand Down

0 comments on commit eb4c7ec

Please sign in to comment.