Is there a way to temporarily change the log level without restarting the ivy engine?

asked 27.09.2018 at 08:46

Bruno%20B%C3%BCtler's gravatar image

Bruno Bütler
accept rate: 68%

The easiest way is to use a little process with a script step and the following code:

import org.apache.log4j.Level;
ivy.log.setLevel(Level.DEBUG as Level);

answered 27.09.2018 at 08:52

Bruno%20B%C3%BCtler's gravatar image

Bruno Bütler
accept rate: 68%

hi @Bruno Bütler It's seem that this setting only apply for project that we run this command. For other projects on same application ,it won't work. Is there any way to make it globally for engine? Thanks

(24.10.2018 at 23:29) trungdv trungdv's gravatar image

I have enhanced this one to make it affect for application scope

public static void changeLevel(Level level){
    if(level != null) {
        org.apache.log4j.Logger root = Logger.getRootLogger();
        Enumeration allLoggers = root.getLoggerRepository().getCurrentCategories();
        //set logging level of root and all logging instances in the system
        while (allLoggers.hasMoreElements()){
            Category tmpLogger = (Category) allLoggers.nextElement();

Here is an Ivy project to do this stuff on engine (with GUI)


answered 25.10.2018 at 00:01

trungdv's gravatar image

accept rate: 52%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 27.09.2018 at 08:46

Seen: 2,826 times

Last updated: 25.10.2018 at 00:01