Ask Your Question
0

Log verbosity settings in karaf

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

sidhant13 gravatar image

Hello,

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

log4j.logger.org.opendaylight.openflowplugin = ERROR
log4j.logger.org.opendaylight.openflowjava = ERROR
log4j.logger.org.opendaylight.ovsdb = 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?

Thanks

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

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

Comments

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
0

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.

        <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>copy-resources</id>
                <phase>validate</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${basedir}/target/assembly/etc</outputDirectory>
                  <overwrite>true</overwrite>         
                  <resources> 
                    <resource>
                      <directory>res</directory>
                      <filtering>true</filtering>
                    </resource>
                  </resources>              
                </configuration>            
              </execution>
            </executions>
          </plugin>
edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

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

Seen: 243 times

Last updated: Aug 29 '16