简体   繁体   中英

How can I set a different log level for a Custom Gradle Plugin

I'm writing a flyway wrapper plugin for gradle. Flyway already uses log4j for it's message logging.

On the info level all the output is relevant to the user.

When I add the custom plugin to new project and run one of its tasks than nothing is displayed in the output. I have to run gradle flywayStatus --info to see the messages.

Is there a way to change the log4j settings in the plugin so that the log level does not need to be modified in the projects that use the plugin?

Any idea would really be appreciated.

Thanks, Gerwin

You can get access to the LoggingManager for the task by calling its getLogging() method.

You can set the logging level on the Manager.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM