Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
koenighotze committed Oct 5, 2023
1 parent 885486e commit e16baa2
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ book2.json
bodleian-service-test.log
*gz
.gradle
logs/
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
fileignoreconfig:
- filename: .github/workflows/build-and-deploy.yml
checksum: 708278df98ed10eb581e7d25fe16c818cec4696ae3f6b1b9b3a3737fac4b5519
- filename: .github/workflows/build-and-deploy.yml
checksum: cf1042b83f6f20ed108940ee4aa2d8663c3901612984c5b2f96d8c390c66db33
- filename: build.gradle.kts
Expand Down
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ repositories {
mavenCentral()
}

configurations.all {
exclude(group = "org.springframework.boot", module = "spring-boot-starter-logging")
}

dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
// implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
// implementation("org.springframework.boot:spring-boot-starter-data-rest")
// implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-log4j2")


implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
// implementation("org.flywaydb:flyway-core")
Expand Down Expand Up @@ -89,6 +96,7 @@ tasks.named("test", Test::class.java) {
filter {
includeTestsMatching("*Test.*")
}
testLogging.showStandardStreams = true
// from docu
maxParallelForks = (getRuntime().availableProcessors() / 2).coerceAtLeast(1)
}
Expand All @@ -107,6 +115,7 @@ tasks.register("integrationTests", Test::class.java) {
filter {
excludeTestsMatching("*Test.*")
}
testLogging.showStandardStreams = true
}
tasks.named("check") {
dependsOn("integrationTests")
Expand Down
9 changes: 0 additions & 9 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,3 @@ spring:
console:
enabled: true
path: /h2-console

logging:
threshold:
console: INFO
level:
org:
hibernate:
type: INFO
stat: INFO
35 changes: 35 additions & 0 deletions src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Properties>
<Property name="LOG_PATTERN">
%d{yyyy-MM-dd HH:mm:ss.SSS} --- thread_id="%tid" thread_name="%tn" thread_priority="%tp" --- [%p] %m%n
</Property>
<Property name="CONSOLE_PATTERN">
%style{%d{ISO8601}}{black} [%highlight{%-5level }] [%style{%t}{bright,blue}] %style{%C{1.}}{bright,yellow}: %m%n%throwable
</Property>
</Properties>
<Appenders>
<RollingFile name="RollingName" filename="logs/app.log"
filePattern="logs/$${date:yyyy-MM}/app-%d{yyyy-MM-dd}-%i.log">
<JSONLayout compact="true" eventEol="true" properties="true" stacktraceAsString="true"
includeTimeMillis="true"/>
<Policies>
<OnStartupTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="5 MB"/>
<TimeBasedTriggeringPolicy/>
</Policies>
</RollingFile>
<Console name="Console" target="SYSTEM_OUT">
<ThresholdFilter level="info"/>
<PatternLayout pattern="${CONSOLE_PATTERN}"/>
</Console>
</Appenders>
<Loggers>
<Logger name="org.koenighotze" level="debug"/>
<Logger name="org.springframework" level="debug"/>
<Root level="warn">
<AppenderRef ref="RollingName"/>
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
12 changes: 0 additions & 12 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,3 @@ spring:
hibernate:
format_sql: true
generate_statistics: true

logging:
threshold:
console: INFO
file: TRACE
level:
org:
hibernate:
type: DEBUG
stat: DEBUG
file:
name: bodleian-service-test.log
22 changes: 22 additions & 0 deletions src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Properties>
<Property name="CONSOLE_PATTERN">
%style{%d{ISO8601}}{black} [%highlight{%-5level }] [%style{%t}{bright,blue}] %style{%C{1.}}{bright,yellow}: %m%n%throwable
</Property>
</Properties>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="${CONSOLE_PATTERN}"/>
</Console>
</Appenders>
<Loggers>
<Logger name="org.koenighotze" level="debug"/>
<Logger name="org.springframework" level="info"/>
<Logger name="org.hibernate.type" level="debug"/>
<Logger name="org.hibernate.stat" level="debug"/>
<Root level="warn">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

0 comments on commit e16baa2

Please sign in to comment.