Skip to content

Commit

Permalink
Added description to health status
Browse files Browse the repository at this point in the history
  • Loading branch information
hohonuuli committed Dec 14, 2021
1 parent e52126d commit e26c55b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 38 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/org/mbari/m3/panoptes/AppConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ object AppConfig {

val Version: String = Try(getClass.getPackage.getImplementationVersion).getOrElse("0.0.0-SNAPSHOT")

val Description: String = "Image Archiver"

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ final case class HealthStatus(
maxMemory: Long,
totalMemory: Long,
application: String = AppConfig.Name,
version: String = AppConfig.Version
version: String = AppConfig.Version,
description: String = AppConfig.Description
)

object HealthStatus {
Expand Down
40 changes: 19 additions & 21 deletions src/pack/conf/logback.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Logging Configuration.
-->
<configuration scan="false" debug="false">

<configuration>
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />

<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<variable name="LOGBACK_LEVEL" value="${LOGBACK_LEVEL:-INFO}" />

<variable name="LOGBACK_LEVEL" value="${LOGBACK_LEVEL:-WARN}" />
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%gray(%d{HH:mm:ss.SSS}) %highlight(%-5level) [%green(%-25thread)] %blue(%-40logger{40}) %gray(|) %msg%n</pattern>
</encoder>
</appender>

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<withJansi>true</withJansi>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!-- <pattern>%d{yyyy-MM-dd HH:mm:ss} [%t] %p %c - %m%n</pattern> -->
<!-- <pattern>%gray(%d{yyyy-MM-dd HH:mm:ss}) %highlight(%p) [%green(%t)] %blue(%c) | %m%n</pattern> -->
<pattern>%gray(%d{HH:mm:ss.SSS}) %highlight(%-5level) [%green(%-25thread)] %blue(%-40logger{40}) %gray(|) %msg%n</pattern>
</encoder>
</appender>
<logger name="httpclient.wire.header" level="WARN" />
<logger name="org.eclipse.jetty" level="WARN" />
<logger name="org.fusesource.scalate" level="WARN" />
<logger name="org.fusesource.scalate" level="WARN" />

<logger name="org.fusesource.scalate" level="WARN" />
<logger name="httpclient.wire.header" level="WARN" />

<root level="${LOGBACK_LEVEL}">
<appender-ref ref="CONSOLE" />
</root>
<root level="${LOGBACK_LEVEL}">
<appender-ref ref="CONSOLE" />
</root>

</configuration>
34 changes: 18 additions & 16 deletions src/test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Logging Configuration.
-->
<configuration scan="false" debug="false">

<configuration>
<variable name="LOGBACK_LEVEL" value="${LOGBACK_LEVEL:-DEBUG}" />

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!-- <pattern>%d{yyyy-MM-dd HH:mm:ss}, %p, %c, %t %m%n</pattern> -->
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%t] %p %c - %m%n</pattern>
</encoder>
</appender>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%gray(%d{HH:mm:ss.SSS}) %highlight(%-5level) [%green(%-25thread)] %blue(%-40logger{40}) %gray(|) %msg%n</pattern>
</encoder>
</appender>

<logger name="org.fusesource.scalate" level="WARN" />
<logger name="httpclient.wire.header" level="WARN" />
<logger name="httpclient.wire.header" level="WARN" />
<logger name="org.apache.http" level="WARN" />
<logger name="org.eclipse.jetty" level="WARN" />
<logger name="org.fusesource.scalate" level="WARN" />

<root level="WARN">
<appender-ref ref="CONSOLE"/>
</root>
<root level="${LOGBACK_LEVEL}">
<appender-ref ref="CONSOLE" />
</root>

</configuration>

0 comments on commit e26c55b

Please sign in to comment.