Disable ignite console logs ...

classic Classic list List threaded Threaded
10 messages Options
myset myset
Reply | Threaded
Open this post in threaded view
|

Disable ignite console logs ...

This post has NOT been accepted by the mailing list yet.
Hi,
I've tried to disable all the console logs of ignite but not completely successfull.
-DIGNITE_QUIET=true                                                         - not working
-DIGNITE_NO_ASCII=true                                                   - works
-DIGNITE_CONSOLE_APPENDER=false                                  - not working
-DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true    - works

Still remain many WARNS, [Date] Message lines.

A better way to manage all this messages is to put it all into gridLogger.


Artem Shutak Artem Shutak
Reply | Threaded
Open this post in threaded view
|

Re: Disable ignite console logs ...

Hi,

I do not exactly understand what do you want...

How do you run ignite: from code or via ignite.<sh|bat>?

Anyway, a better way to work with ignite logging use ignite-log4j and properly configure it.

And, if you don't want to see any logs at console you can simply redirect all output of process to file.
Artem Shutak Artem Shutak
Reply | Threaded
Open this post in threaded view
|

Re: Disable ignite console logs ...

More detailed answer:
1. To enable log4j
- at ignite.{sh|bat} case, just copy ignite-log4j directory from libs/optional to libs/.
- if you use maven, then add maven dependency

        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-log4j</artifactId>
            <version>${ignite.version}</version>
        </dependency>

2. If you want use java logging then see at config/java.util.logging.properties and provide your own configuration. From the file comments:

#       Default java.util.logging configuration for Ignite.
#
# To use another config file use `java.util.logging.config.file` system
# property. For example `java -Djava.util.logging.config.file=myfile`

3. For more information about options which you are use, see at org.apache.ignite.IgniteSystemProperties documentation. For example, javadoc for IGNITE_QUIET says:

     * Set to either true or false to enable or disable quiet mode
     * of Ignite. In quiet mode, only warning and errors are printed into the log
     * additionally to a shortened version of standard output on the start.
     *
     * Note that if you use ignite.{sh|bat} scripts to start Ignite they
     * start by default in quiet mode. You can supply -v flag to override it.
 
myset myset
Reply | Threaded
Open this post in threaded view
|

Re: Disable ignite console logs ...

I'm using IgniteSpringBean initialisation class and JCL with log4j2.
dsetrakyan dsetrakyan
Reply | Threaded
Open this post in threaded view
|

Re: Disable ignite console logs ...

myset wrote
I'm using IgniteSpringBean initialisation class and JCL with log4j2.
I this case I believe you need to disable the ConsoleAppender for System OUT and ERROR.
myset myset
Reply | Threaded
Open this post in threaded view
|

Re: Disable ignite console logs ...

I'd turned off all JCL - log4j2 (thresholds and appenders) and still remain the following (and many other)

[09:13:17] Configured plugins:
[09:13:17]   ^-- None
[09:13:17]
[09:13:18] To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}
[09:13:18]
[09:13:18] Ignite node started OK (id=18e9f48a, grid=myset)
[09:13:18] Topology snapshot [ver=1, nodes=1, CPUs=8, heap=0.89GB]

Why the following properties doesn't work ?
-DIGNITE_QUIET=true                                                         - not working
-DIGNITE_CONSOLE_APPENDER=false                                 - not working



Artem Shutak Artem Shutak
Reply | Threaded
Open this post in threaded view
|

Re: Disable ignite console logs ...

Hi,

In some cases Ignite print some messages directly at System.out. For me, it looks like a bug. I filed: https://issues.apache.org/jira/browse/IGNITE-923.

I can suggest workflow while the bug is not fixed. Need to configure separate logger for "org.ignite.logger" in DEBUG (or higher) level:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
        </Console>
    </Appenders>
    <Loggers>
        <Logger name="org.apache.ignite" level="DEBUG" additivity="false">
           
        </Logger>
        <Root level="DEBUG">
            <AppenderRef ref="Console"/>
        </Root>
    </Loggers>
</Configuration>

Also, I want to suggest to check that you configured jcl logger properly:
- java way
        IgniteConfiguration cfg = new IgniteConfiguration();
        cfg.setGridLogger(new IgniteJclLogger());
- spring
        <property name="gridLogger">
            <bean class="org.apache.ignite.logger.jcl.JclLogger"/>
        </property>
 
myset myset
Reply | Threaded
Open this post in threaded view
|

Re: Disable ignite console logs ...

Thank you for answer Artem
All logs are well configured and everything works well in terms of ignite logging (my case JCL).
Some log lines still remain in console in standard ignite log line pattern ... seems to be a bug ...
Artem Shutak wrote
In some cases Ignite print some messages directly at System.out. For me, it looks like a bug. I filed: https://issues.apache.org/jira/browse/IGNITE-923.
Artem Shutak Artem Shutak
Reply | Threaded
Open this post in threaded view
|

Re: Disable ignite console logs ...

Hi,

1. I was a little wrong and it's enough for workflow to configure separate logger for "org.ignite.logger" in INFO or higher (not in DEBUG or higher) level.

2. I have test
    public static void main(String[] args) throws InterruptedException {
        IgniteConfiguration cfg = new IgniteConfiguration();

        cfg.setGridLogger(new IgniteJclLogger());

        try(Ignite ignite = Ignition.start(cfg)) {
            Thread.sleep(100_000);
        }
    }

with log4j2 configuration:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
        </Console>
    </Appenders>
    <Loggers>
        <Logger name="org.apache.ignite" level="INFO" additivity="false">
           
        </Logger>
        <Root level="DEBUG">
            <AppenderRef ref="Console"/>
        </Root>
    </Loggers>
</Configuration>

I run this test without some env. variables (without IGNITE_QUITE and etc.) and don't see any logs at console.

3. Please, check your ignite/log4j2 configuration and etc.
If you will still see any logs at console, when I need more information to next investigations (double check your env. variables). In best case it should be simple example as I provide at point 2 with:
- java-code example to run Ignite
- log4j2 configuration
- logs that you see at console.

4. To track progress about the current bug, please, see at https://issues.apache.org/jira/browse/IGNITE-923.
Also, I can propose to contribute at Ignite and fix this by yourself! It would be really great!


Ok, I think to next investigations I need more information:
-
myset myset
Reply | Threaded
Open this post in threaded view
|

Re: Disable ignite console logs ...

Thank you for answer,

I use pretty the same log4j2 configuration but still remain in console some ignite logs in standard format
Even if I change level or line pattern all those line remain in the same format.

Artem Shutak wrote
3. Please, check your ignite/log4j2 configuration and etc.
If you will still see any logs at console, when I need more information to next investigations (double check your env. variables). In best case it should be simple example as I provide at point 2 with:
- java-code example to run Ignite
- log4j2 configuration
- logs that you see at console.

[18:37:01] Configured plugins:
[18:37:01]   ^-- None
[18:37:01]
[18:37:01] To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}
[18:37:01]
[18:37:01] Ignite node started OK (id=76d313ad, grid=myset)
[18:37:01] Topology snapshot [ver=1, nodes=1, CPUs=8, heap=0.89GB]

I'll follow recommended issue status.