Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-16650 Migrates logging to log4j2. #167

Merged
merged 3 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions modules/aop-ext/modules/core/src/test/config/log4j-test.xml

This file was deleted.

40 changes: 40 additions & 0 deletions modules/aop-ext/modules/core/src/test/config/log4j2-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<Configuration>
<Appenders>
<Console name="CONSOLE" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{ISO8601}][%-5p][%t][%c{1}]%notEmpty{[%markerSimpleName]} %m%n"/>
<LevelRangeFilter minLevel="INFO" maxLevel="DEBUG"/>
</Console>

<Console name="CONSOLE_ERR" target="SYSTEM_ERR">
<PatternLayout pattern="[%d{ISO8601}][%-5p][%t][%c{1}] %m%n"/>
</Console>
</Appenders>

<Loggers>
<Logger name="org" level="INFO"/>

<Root level="INFO">
<AppenderRef ref="CONSOLE" level="DEBUG"/>
<AppenderRef ref="CONSOLE_ERR" level="WARN"/>
</Root>
</Loggers>
</Configuration>
2 changes: 1 addition & 1 deletion modules/aop-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ignite-log4j</artifactId>
<artifactId>ignite-log4j2</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.loadtests.GridLoadTestStatistics;
import org.apache.ignite.logger.log4j.Log4JLogger;
import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.config.GridTestProperties;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
import org.apache.log4j.Level;
import org.apache.logging.log4j.core.config.Configurator;
import org.junit.Ignore;
import org.junit.Test;

import static org.apache.logging.log4j.Level.INFO;

/**
* Single split load test.
*/
Expand All @@ -53,9 +54,7 @@ public SingleSplitsLoadTest() {
cfg.setCommunicationSpi(new TcpCommunicationSpi());
cfg.setDiscoverySpi(new TcpDiscoverySpi());

Log4JLogger log = (Log4JLogger)cfg.getGridLogger().getLogger(null);

log.setLevel(Level.INFO);
Configurator.setRootLevel(INFO);

return cfg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.loadtests.GridLoadTestStatistics;
import org.apache.ignite.logger.log4j.Log4JLogger;
import org.apache.ignite.spi.communication.CommunicationSpi;
import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.DiscoverySpi;
Expand All @@ -30,10 +29,12 @@
import org.apache.ignite.testframework.config.GridTestProperties;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
import org.apache.log4j.Level;
import org.apache.logging.log4j.core.config.Configurator;
import org.junit.Ignore;
import org.junit.Test;

import static org.apache.logging.log4j.Level.INFO;

/**
* Gridify single split load test.
*/
Expand Down Expand Up @@ -67,12 +68,8 @@ public GridifySingleSplitLoadTest() {
DiscoverySpi discoSpi = new TcpDiscoverySpi();

cfg.setDiscoverySpi(discoSpi);
/*
*/
@SuppressWarnings("TypeMayBeWeakened")
Log4JLogger log = (Log4JLogger)cfg.getGridLogger();

log.getLogger("org.apache.ignite").setLevel(Level.INFO);
Configurator.setLevel("org.apache.ignite", INFO);

return cfg;
}
Expand Down
57 changes: 0 additions & 57 deletions modules/aws-ext/modules/core/src/test/config/log4j-test.xml

This file was deleted.

40 changes: 40 additions & 0 deletions modules/aws-ext/modules/core/src/test/config/log4j2-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<Configuration>
<Appenders>
<Console name="CONSOLE" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{ISO8601}][%-5p][%t][%c{1}]%notEmpty{[%markerSimpleName]} %m%n"/>
<LevelRangeFilter minLevel="INFO" maxLevel="DEBUG"/>
</Console>

<Console name="CONSOLE_ERR" target="SYSTEM_ERR">
<PatternLayout pattern="[%d{ISO8601}][%-5p][%t][%c{1}] %m%n"/>
</Console>
</Appenders>

<Loggers>
<Logger name="org" level="INFO"/>

<Root level="INFO">
<AppenderRef ref="CONSOLE" level="DEBUG"/>
<AppenderRef ref="CONSOLE_ERR" level="WARN"/>
</Root>
</Loggers>
</Configuration>
4 changes: 2 additions & 2 deletions modules/aws-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>

Expand Down
57 changes: 0 additions & 57 deletions modules/azure-ext/modules/core/src/test/config/log4j-test.xml

This file was deleted.

40 changes: 40 additions & 0 deletions modules/azure-ext/modules/core/src/test/config/log4j2-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<Configuration>
<Appenders>
<Console name="CONSOLE" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{ISO8601}][%-5p][%t][%c{1}]%notEmpty{[%markerSimpleName]} %m%n"/>
<LevelRangeFilter minLevel="INFO" maxLevel="DEBUG"/>
</Console>

<Console name="CONSOLE_ERR" target="SYSTEM_ERR">
<PatternLayout pattern="[%d{ISO8601}][%-5p][%t][%c{1}] %m%n"/>
</Console>
</Appenders>

<Loggers>
<Logger name="org" level="INFO"/>

<Root level="INFO">
<AppenderRef ref="CONSOLE" level="DEBUG"/>
<AppenderRef ref="CONSOLE_ERR" level="WARN"/>
</Root>
</Loggers>
</Configuration>
4 changes: 2 additions & 2 deletions modules/azure-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Loading