Fixed logging plugin writing over by default an already copied config.
This commit is contained in:
parent
31c099b6fb
commit
d99e28178d
@ -25,9 +25,10 @@ class GroowtLoggingPlugin implements Plugin<Project> {
|
||||
|
||||
javaExtension.sourceSets.each { sourceSet ->
|
||||
project.tasks.register(
|
||||
sourceSet.getTaskName('copy', 'LoggingConfig'),
|
||||
sourceSet.getTaskName('copyLoggingConfigTo', 'Resources'),
|
||||
GroowtCopyLoggerConfigTask
|
||||
) { task ->
|
||||
task.group = 'logging'
|
||||
task.from(tmpLog4j2Xml)
|
||||
task.rename { 'log4j2.xml' }
|
||||
task.into(['src', sourceSet.name, 'resources'].join(File.separator))
|
||||
@ -45,10 +46,6 @@ class GroowtLoggingPlugin implements Plugin<Project> {
|
||||
project.dependencies.addProvider(
|
||||
'runtimeOnly', libs.findLibrary('log4j-slf4jBinding').orElseThrow()
|
||||
)
|
||||
|
||||
project.tasks.named('build') {
|
||||
it.dependsOn project.tasks.withType(GroowtCopyLoggerConfigTask)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
17
cli/src/main/resources/log4j2.xml
Normal file
17
cli/src/main/resources/log4j2.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Configuration xmlns="http://logging.apache.org/log4j/2.0/config">
|
||||
<Appenders>
|
||||
<Console name="root">
|
||||
<PatternLayout>
|
||||
<LevelPatternSelector defaultPattern="[%t] %-5level %logger{1.} %msg%n">
|
||||
<PatternMatch key="DEBUG" pattern="[%t] %-5level %logger{1.}.%M() %msg%n"/>
|
||||
</LevelPatternSelector>
|
||||
</PatternLayout>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="INFO">
|
||||
<AppenderRef ref="root"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
Loading…
Reference in New Issue
Block a user