Ask Your Question

Log verbosity settings in karaf

asked 2016-08-24 09:04:26 -0700

sidhant13 gravatar image


Is there a way to set default log level in karaf. For instance, Openflowplugin and OVSDB plugins are producing a lot of warning messages and every time I build karaf, I have to write following 3 commands again.

opendaylight-user@root>log:set error org.opendaylight.ovsdb
opendaylight-user@root>log:set error org.opendaylight.openflowjava
opendaylight-user@root>log:set error org.opendaylight.opendaylightplugin

Or the other workoaround is to add the follwoing in file org.ops4j.pax.logging.cfg in karaf/target/assembly/etc folder = ERROR = ERROR = ERROR

But this too has to be done every new build.

Is their some concrete and persistent way to configure that, like maybe a property in karaf pom file?


edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2016-08-25 07:36:07 -0700

Those settings are persistent between OpenDaylight restarts, if you keep all directories.

If what you want to do is to persist those settings between BUILDS, then you need work with one of the Maven plugins that can do the change while assembling the distribution, maybe maven-resources-plugin, to add your changed file.

edit flag offensive delete publish link more


Thanks Lori, I will have a look at the maven-resources-plugin and try to get back on it.

sidhant13 ( 2016-08-26 08:47:42 -0700 )edit

answered 2016-08-29 06:12:27 -0700

sidhant13 gravatar image

I tried the first answer by using maven-resource-plugin to copy the org.ops4j.pax.logging.cfg file with custom log settings into target folder after a build. I copied the following into my karaf pom file. It does copy the file but I guess the original org.ops4j.pax.logging.cfg file is produced after this plugin is executed. So the base log file without custom log settings overrides our log setting file. But it does work when I copy the plugin into my parent pom, so not the exact solution but hits nearby for now.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-08-24 09:04:26 -0700

Seen: 154 times

Last updated: Aug 29 '16