Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change log level for particular maven plugin

I want to change the log level for a particular maven plugin, ideally from within the pom.xml, less than ideal but still acceptable by a command line switch.

In particular I want INFO in general but only WARN from maven-shade-plugin:3.1.0.

like image 533
scravy Avatar asked Nov 08 '22 10:11

scravy


1 Answers

You can configure it with simplelogger.properties file. Add following line to the properties file located at {maven.home}/conf/logging/simplelogger.properties

org.slf4j.simpleLogger.log.org.apache.maven.plugins.shade=warn

Info level is the default level for all loggers, which is also set at properties file (If you want to change it in the future)

org.slf4j.simpleLogger.defaultLogLevel=info

If you want to do it with command switch you can add following to your maven command. (I prefer modifying properties file)

-Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.shade=warn
like image 104
miskender Avatar answered Nov 15 '22 05:11

miskender