47 |
48 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | dist: trusty
2 |
3 | language: java
4 |
5 | jdk:
6 | - oraclejdk11
7 |
8 | notifications:
9 | email:
10 | - notification@qos.ch
11 |
12 | install: /bin/true
13 |
14 | script:
15 | - mvn clean
16 | - mvn install
17 |
18 | cache:
19 | directories:
20 | - $HOME/.m2
21 |
--------------------------------------------------------------------------------
/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: qos-ch
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2004-2022 QOS.ch Sarl (Switzerland)
2 | All rights reserved.
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 | ## Reporting security issues
3 |
4 | Please report security issues related to the SLF4J project to the
5 | following email address:
6 |
7 | support(at)qos.ch
8 |
9 |
10 |
11 |
12 | ## Verifying contents
13 |
14 | All SLF4J project artifacts published on Maven central are signed. For
15 | each artifact, there is an associated signature file with the .asc
16 | suffix.
17 |
18 | ### After 2022-08-08
19 |
20 | To verify the signature use [this public key](https://www.slf4j.org/public-keys/60200AC4AE761F1614D6C46766D68DAA073BE985.gpg). Here is its fingerprint:
21 | ```
22 | pub nistp521 2022-08-08 [SC]
23 | 60200AC4AE761F1614D6C46766D68DAA073BE985
24 | uid Ceki Gulcu
25 | sub nistp521 2022-08-08 [E]
26 | ```
27 |
28 | A copy of this key is stored on the
29 | [keys.openpgp.org](https://keys.openpgp.org) keyserver. To add it to
30 | your public key ring use the following command:
31 |
32 | ```
33 | > FINGER_PRINT=60200AC4AE761F1614D6C46766D68DAA073BE985
34 | > gpg --keyserver hkps://keys.openpgp.org --recv-keys $FINGER_PRINT
35 | ```
36 |
37 | ### Before 2022-08-08
38 |
39 | To verify the signature use [this public key](https://www.slf4j.org/public-keys/ceki-public-key.pgp). Here is its fingerprint:
40 |
41 | ```
42 | pub 2048R/A511E325 2012-04-26
43 | Key fingerprint = 475F 3B8E 59E6 E63A A780 6748 2C7B 12F2 A511 E325
44 | uid Ceki Gulcu
45 | sub 2048R/7FBFA159 2012-04-26
46 | ```
47 |
48 | A copy of this key is stored on the
49 | [keys.openpgp.org](https://keys.openpgp.org) keyserver. To add it to
50 | your public key ring use the following command:
51 |
52 | ```
53 | > FINGER_PRINT=475F3B8E59E6E63AA78067482C7B12F2A511E325
54 | > gpg --keyserver hkps://keys.openpgp.org --recv-keys $FINGER_PRINT
55 | ```
56 |
57 |
58 | ## Preventing commit history overwrite
59 |
60 | In order to prevent loss of commit history, developers of the project
61 | are highly encouraged to deny branch deletions or history overwrites
62 | by invoking the following two commands on their local copy of the
63 | repository.
64 |
65 |
66 | ```
67 | git config receive.denyDelete true
68 | git config receive.denyNonFastForwards true
69 | ```
--------------------------------------------------------------------------------
/integration/lib/junit-3.8.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/junit-3.8.1.jar
--------------------------------------------------------------------------------
/integration/lib/slf4j-api-1.5.11.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/slf4j-api-1.5.11.jar
--------------------------------------------------------------------------------
/integration/lib/slf4j-api-1.6.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/slf4j-api-1.6.6.jar
--------------------------------------------------------------------------------
/integration/lib/slf4j-api-1.6.99.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/slf4j-api-1.6.99.jar
--------------------------------------------------------------------------------
/integration/lib/slf4j-api-2.0.99.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/slf4j-api-2.0.99.jar
--------------------------------------------------------------------------------
/integration/lib/slf4j-nop-1.5.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/slf4j-nop-1.5.6.jar
--------------------------------------------------------------------------------
/integration/lib/slf4j-simple-1.4.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/slf4j-simple-1.4.2.jar
--------------------------------------------------------------------------------
/integration/lib/slf4j-simple-1.5.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/slf4j-simple-1.5.0.jar
--------------------------------------------------------------------------------
/integration/lib/slf4j-simple-1.5.11.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/slf4j-simple-1.5.11.jar
--------------------------------------------------------------------------------
/integration/lib/slf4j-simple-1.6.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/slf4j-simple-1.6.6.jar
--------------------------------------------------------------------------------
/integration/lib/slf4j-simple-1.6.99.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/integration/lib/slf4j-simple-1.6.99.jar
--------------------------------------------------------------------------------
/integration/src/IBUNDLE-META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Archiver-Version: Plexus Archiver
3 | Created-By: Apache Maven
4 | Built-By: ceki
5 | Build-Jdk: 1.6.0_16
6 | Bundle-Description: iBundle
7 | Bundle-Version: 0.1
8 | Bundle-Activator: integrator.Activator
9 | Implementation-Title: iBundle
10 | Bundle-ManifestVersion: 2
11 | Bundle-SymbolicName: iBundle
12 | Bundle-Name: abundle
13 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8
14 | Export-Package: apack
15 | Import-Package: org.osgi.framework, org.slf4j;version=1.5
--------------------------------------------------------------------------------
/integration/src/policy/java-eclipse.policy:
--------------------------------------------------------------------------------
1 |
2 | grant {
3 |
4 | // note that java.lang.RuntimePermission createSecurityManager is NOT granted
5 |
6 | permission java.util.PropertyPermission "user.dir", "read";
7 | permission java.util.PropertyPermission "*", "read";
8 |
9 | permission java.net.SocketPermission "*", "connect,resolve";
10 | };
--------------------------------------------------------------------------------
/integration/src/policy/java-under-ant.policy:
--------------------------------------------------------------------------------
1 |
2 | grant {
3 |
4 | // note that java.lang.RuntimePermission createSecurityManager is NOT granted
5 |
6 | permission java.util.PropertyPermission "user.dir", "read";
7 |
8 | // permissions required for Ant's Junit runner
9 | permission java.util.PropertyPermission "*", "read, write";
10 | permission java.io.FilePermission "./-", "read";
11 | permission java.io.FilePermission "./-", "write";
12 | permission java.lang.RuntimePermission "setIO";
13 | };
--------------------------------------------------------------------------------
/integration/src/test/java/integrator/Activator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2004-2011 QOS.ch
3 | * All rights reserved.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | *
24 | */
25 | package integrator;
26 |
27 | import org.osgi.framework.Bundle;
28 | import org.osgi.framework.BundleActivator;
29 | import org.osgi.framework.BundleContext;
30 | import org.slf4j.Logger;
31 | import org.slf4j.LoggerFactory;
32 |
33 | /**
34 | * A BundleActivator which invokes slf4j loggers
35 | * @author Ceki Gülcü
36 | *
37 | */
38 | public class Activator implements BundleActivator {
39 |
40 | private BundleContext m_context = null;
41 |
42 | public void start(BundleContext context) {
43 | Logger logger = LoggerFactory.getLogger(this.getClass());
44 | logger.info("Activator.start()");
45 | m_context = context;
46 | }
47 |
48 | public void stop(BundleContext context) {
49 | m_context = null;
50 | Logger logger = LoggerFactory.getLogger(this.getClass());
51 | logger.info("Activator.stop");
52 | }
53 |
54 | public Bundle[] getBundles() {
55 | if (m_context != null) {
56 | return m_context.getBundles();
57 | }
58 | return null;
59 | }
60 | }
--------------------------------------------------------------------------------
/integration/src/test/java/org/slf4j/NoProviderAssertionTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2004-2016 QOS.ch
3 | * All rights reserved.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | *
24 | */
25 | package org.slf4j;
26 |
27 | import java.io.PrintStream;
28 | import java.util.Random;
29 |
30 | import org.junit.After;
31 | import org.junit.Before;
32 | import org.junit.Test;
33 |
34 | public class NoProviderAssertionTest {
35 |
36 | StringPrintStream sps = new StringPrintStream(System.err);
37 | PrintStream old = System.err;
38 | int diff = 1024 + new Random().nextInt(10000);
39 |
40 | @Before
41 | public void setUp() throws Exception {
42 | System.setErr(sps);
43 | }
44 |
45 | @After
46 | public void tearDown() throws Exception {
47 | System.setErr(old);
48 | }
49 |
50 | @Test
51 | public void test() throws Exception {
52 | Logger logger = LoggerFactory.getLogger(this.getClass());
53 | String msg = "hello world " + diff;
54 | logger.info(msg);
55 | OutputVerifier.noProvider(sps);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/integration/src/test/java/org/slf4j/OutputVerifier.java:
--------------------------------------------------------------------------------
1 | package org.slf4j;
2 |
3 | import static junit.framework.Assert.assertTrue;
4 |
5 | public class OutputVerifier {
6 |
7 | static void noProvider(StringPrintStream sps) {
8 | dump(sps);
9 | int lineCount = sps.stringList.size();
10 | assertTrue("number of lines should be 6 but was " + lineCount, lineCount == 6);
11 |
12 | // expected output: (version 1.8)
13 | // SLF4J: No SLF4J providers were found.
14 | // SLF4J: Defaulting to no-operation (NOP) logger implementation
15 | // SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
16 | // SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8.
17 | // SLF4J: Ignoring binding found at
18 | // [jar:file:..../slf4j-simple-1.4.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
19 | // SLF4J: See http://www.slf4j.org/codes.html#ignoredBindings for an explanation.
20 |
21 | {
22 | String s = (String) sps.stringList.get(0);
23 | assertTrue(s.contains("No SLF4J providers were found."));
24 | }
25 | {
26 | String s = (String) sps.stringList.get(1);
27 | assertTrue(s.contains("Defaulting to no-operation (NOP) logger implementation"));
28 | }
29 | {
30 | String s = (String) sps.stringList.get(2);
31 | assertTrue(s.contains("See https://www.slf4j.org/codes.html#noProviders for further details."));
32 | }
33 |
34 | {
35 | String s = (String) sps.stringList.get(3);
36 | assertTrue(s.contains("Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier."));
37 | }
38 |
39 | {
40 | String s = (String) sps.stringList.get(4);
41 | assertTrue(s.contains("Ignoring binding found at"));
42 | }
43 | {
44 | String s = (String) sps.stringList.get(5);
45 | assertTrue(s.contains("See https://www.slf4j.org/codes.html#ignoredBindings for an explanation"));
46 | }
47 | }
48 |
49 | public static void dump(StringPrintStream sps) {
50 | for (String s : sps.stringList) {
51 | System.out.println(s);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/integration/src/test/java/org/slf4j/StringPrintStream.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2004-2011 QOS.ch
3 | * All rights reserved.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | *
24 | */
25 | package org.slf4j;
26 |
27 | import java.io.PrintStream;
28 | import java.util.ArrayList;
29 | import java.util.List;
30 |
31 | public class StringPrintStream extends PrintStream {
32 |
33 | public static final String LINE_SEP = System.getProperty("line.separator");
34 | PrintStream other;
35 | List stringList = new ArrayList<>();
36 |
37 | public StringPrintStream(PrintStream ps) {
38 | super(ps);
39 | other = ps;
40 | }
41 |
42 | public void print(String s) {
43 | other.print(s);
44 | stringList.add(s);
45 | }
46 |
47 | public void println(String s) {
48 | other.println(s);
49 | stringList.add(s);
50 | }
51 |
52 | public void println(Object o) {
53 | other.println(o);
54 | stringList.add(o.toString());
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/integration/src/test/java/org/slf4j/issues/Issue324Test.java:
--------------------------------------------------------------------------------
1 | package org.slf4j.issues;
2 |
3 | import org.slf4j.Logger;
4 | import org.slf4j.LoggerFactory;
5 |
6 | import junit.framework.TestCase;
7 |
8 | public class Issue324Test extends TestCase {
9 |
10 | public void testLoggerCreationInPresenceOfSecurityManager() {
11 | String currentDir = System.getProperty("user.dir");
12 | System.out.println("currentDir:" + currentDir);
13 | Logger logger = LoggerFactory.getLogger(Issue324Test.class);
14 | logger.debug("hello");
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/jcl-over-slf4j/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | org.slf4j
7 | slf4j-parent
8 | 2.0.18-SNAPSHOT
9 | ../parent/pom.xml
10 |
11 |
12 | 4.0.0
13 |
14 | jcl-over-slf4j
15 | jar
16 | JCL 1.2 implemented over SLF4J
17 | JCL 1.2 implemented over SLF4J
18 | http://www.slf4j.org
19 |
20 |
21 |
22 | Apache-2.0
23 | https://www.apache.org/licenses/LICENSE-2.0.txt
24 | repo
25 |
26 |
27 |
28 |
29 | org.apache.commons.logging
30 |
31 |
32 |
33 |
34 | org.slf4j
35 | slf4j-api
36 |
37 |
38 | org.slf4j
39 | slf4j-jdk14
40 | test
41 |
42 |
43 |
44 |
45 |
46 |
47 | org.apache.felix
48 | maven-bundle-plugin
49 |
50 |
51 | <_exportcontents>org.apache.commons.logging*;version=${jcl.version};-noimport:=true
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
SLF4J based implementation of commons-logging wrapper APIs.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/jcl-over-slf4j/src/main/java9/module-info.java:
--------------------------------------------------------------------------------
1 | module org.apache.commons.logging {
2 | requires org.slf4j;
3 | exports org.apache.commons.logging;
4 | }
5 |
--------------------------------------------------------------------------------
/jcl-over-slf4j/src/main/resources/META-INF/services/org.apache.commons.logging.LogFactory:
--------------------------------------------------------------------------------
1 | org.apache.commons.logging.impl.SLF4JLogFactory
2 |
3 | # Axis gets at JCL through its own mechanism as defined by Commons Discovery, which
4 | # in turn follows the instructions found at:
5 | # http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service Provider
6 |
--------------------------------------------------------------------------------
/jul-to-slf4j/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2004-2022 QOS.ch Sarl (Switzerland)
2 | All rights reserved.
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/jul-to-slf4j/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | 4.0.0
6 |
7 |
8 | org.slf4j
9 | slf4j-parent
10 | 2.0.18-SNAPSHOT
11 | ../parent/pom.xml
12 |
13 |
14 | jul-to-slf4j
15 |
16 | jar
17 | JUL to SLF4J bridge
18 | JUL to SLF4J bridge
19 |
20 | http://www.slf4j.org
21 |
22 |
23 |
24 | org.slf4j
25 | slf4j-api
26 |
27 |
28 | org.slf4j
29 | slf4j-reload4j
30 | ${project.version}
31 | test
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/jul-to-slf4j/src/main/java/org/slf4j/bridge/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
Bridge/route all JUL log records to the SLF4J API.
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/jul-to-slf4j/src/main/java9/module-info.java:
--------------------------------------------------------------------------------
1 | module jul.to.slf4j {
2 |
3 | requires org.slf4j;
4 | requires java.logging;
5 |
6 | exports org.slf4j.bridge;
7 | }
--------------------------------------------------------------------------------
/jul-to-slf4j/src/test/java/org/slf4j/bridge/ListAppender.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2004-2011 QOS.ch
3 | * All rights reserved.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | *
24 | */
25 | package org.slf4j.bridge;
26 |
27 | import java.util.ArrayList;
28 | import java.util.List;
29 |
30 | import org.apache.log4j.AppenderSkeleton;
31 | import org.apache.log4j.spi.LoggingEvent;
32 |
33 | public class ListAppender extends AppenderSkeleton {
34 |
35 | public List list = new ArrayList<>();
36 |
37 | public boolean extractLocationInfo = false;
38 |
39 | protected void append(LoggingEvent event) {
40 | list.add(event);
41 | if (extractLocationInfo) {
42 | event.getLocationInformation();
43 | }
44 | }
45 |
46 | public void close() {
47 | }
48 |
49 | public boolean requiresLayout() {
50 | return false;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/jul-to-slf4j/src/test/resources/org/slf4j/bridge/testLogStrings.properties:
--------------------------------------------------------------------------------
1 | resource_key=msg
2 | resource_key_1=msg
3 | resource_key_2=msg {0} {1}
4 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/lib/junit-3.8.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/log4j-over-slf4j/compatibility/lib/junit-3.8.1.jar
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/lib/log4j-1.2.14.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/log4j-over-slf4j/compatibility/lib/log4j-1.2.14.jar
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/lib/log4j-1.3alpha-8.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/log4j-over-slf4j/compatibility/lib/log4j-1.3alpha-8.jar
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/lib/log4j-over-slf4j-1.4.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/log4j-over-slf4j/compatibility/lib/log4j-over-slf4j-1.4.2.jar
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/lib/logback-classic-0.9.8-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/log4j-over-slf4j/compatibility/lib/logback-classic-0.9.8-SNAPSHOT.jar
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/lib/logback-core-0.9.8-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/log4j-over-slf4j/compatibility/lib/logback-core-0.9.8-SNAPSHOT.jar
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/lib/slf4j-api-1.4.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qos-ch/slf4j/183aaa507040ce6c61f70762c13e7d11aa4fd54e/log4j-over-slf4j/compatibility/lib/slf4j-api-1.4.2.jar
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/readme.txt:
--------------------------------------------------------------------------------
1 |
2 | This directory is used to test the module against various log4j calls.
3 | Two test cases simulate the typical calls that one can find in an application
4 | that uses either log4j 1.2.x, or log4j 1.3.x.
5 |
6 | In the same directory is a build.xml file that uses ant to
7 | compile the test cases with the corresponding log4j version,
8 | and to run these tests without log4j in the classpath but with
9 | logback jars instead.
10 |
11 | To run the tests, one must have ant installed. Issuing the following command,
12 | once in the compatibility directory will launch the tests:
13 |
14 | ant all
15 |
16 | To obtain more information about the use of the log4j-over-slf4j module,
17 | please visit http://www.slf4j.org/log4j-over-slf4j.html
18 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/src/main/java/test/DummyObject.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | public class DummyObject {
4 |
5 | public String toString() {
6 | return "dummy";
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/src/main/java/test/Log4j12Calls.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Logback: the reliable, generic, fast and flexible logging framework.
3 | *
4 | * Copyright (C) 1999-2006, QOS.ch
5 | *
6 | * This library is free software, you can redistribute it and/or modify it under
7 | * the terms of the GNU Lesser General Public License as published by the Free
8 | * Software Foundation.
9 | */
10 | package test;
11 |
12 | import junit.framework.TestCase;
13 |
14 | import org.apache.log4j.Logger;
15 | import org.apache.log4j.MDC;
16 |
17 | /**
18 | *
19 | * A test case that issues the typical calls
20 | * that an application using log4j 1.2 would do.
21 | *
22 | * @author Ceki Gülcü
23 | * @author Sébastien Pennec
24 | */
25 | public class Log4j12Calls extends TestCase {
26 | public static final Logger logger = Logger.getLogger(Log4j12Calls.class);
27 |
28 | public void testLog() {
29 | MDC.put("key", "value1");
30 |
31 | logger.trace("Trace level can be noisy");
32 | logger.debug("Entering application");
33 | logger.info("Violets are blue");
34 | logger.warn("Here is a warning");
35 | logger.error("Exiting application", new Exception("just testing"));
36 |
37 | MDC.remove("key");
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/compatibility/src/main/java/test/Log4j13Calls.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Logback: the reliable, generic, fast and flexible logging framework.
3 | *
4 | * Copyright (C) 1999-2006, QOS.ch
5 | *
6 | * This library is free software, you can redistribute it and/or modify it under
7 | * the terms of the GNU Lesser General Public License as published by the Free
8 | * Software Foundation.
9 | */
10 |
11 | package test;
12 |
13 | import junit.framework.TestCase;
14 |
15 | import org.apache.log4j.Logger;
16 | import org.apache.log4j.MDC;
17 |
18 | /**
19 | *
20 | * A test case that issues the typical calls
21 | * that an application using log4j 1.3 would do.
22 | *
23 | * @author Ceki Gülcü
24 | * @author Sébastien Pennec
25 | */
26 |
27 | public class Log4j13Calls extends TestCase {
28 | public static final Logger logger = Logger.getLogger(Log4j12Calls.class);
29 |
30 | public void testLog() {
31 | MDC.put("key", "value1");
32 |
33 | logger.trace("Trace level can be noisy");
34 | logger.debug("Entering application");
35 | logger.info("Violets are blue");
36 | logger.warn("Here is a warning");
37 | logger.info("The answer is {}.", new Integer(42));
38 | logger.info("Number: {} and another one: {}.", new Integer(42), new Integer(24));
39 |
40 | logger.error("Exiting application", new Exception("just testing"));
41 |
42 | MDC.remove("key");
43 |
44 | MDC.clear();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | 4.0.0
6 |
7 |
8 | org.slf4j
9 | slf4j-parent
10 | 2.0.18-SNAPSHOT
11 | ../parent/pom.xml
12 |
13 |
14 |
15 | log4j-over-slf4j
16 | jar
17 | Log4j Implemented Over SLF4J
18 | Log4j implemented over SLF4J
19 |
20 | http://www.slf4j.org
21 |
22 |
23 |
24 | Apache-2.0
25 | https://www.apache.org/licenses/LICENSE-2.0.txt
26 |
27 |
28 |
29 |
30 | log4j
31 |
32 |
33 |
34 |
35 | org.slf4j
36 | slf4j-api
37 |
38 |
39 | org.slf4j
40 | slf4j-jdk14
41 | test
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | org.apache.felix
50 | maven-bundle-plugin
51 |
52 |
53 | <_exportcontents>org.apache.log4j*;version=${reload4j.version};-noimport:=true
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/AppenderSkeleton.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.apache.log4j;
17 |
18 | import org.apache.log4j.spi.OptionHandler;
19 |
20 | public class AppenderSkeleton implements OptionHandler {
21 |
22 | public void setLayout(Layout layout) {
23 | }
24 |
25 | public void setName(String name) {
26 | }
27 |
28 | public void activateOptions() {
29 | }
30 |
31 | public void setThreshold(Priority threshold) {
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/BasicConfigurator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.apache.log4j;
18 |
19 | /**
20 | * A minimal (nop) implementation of BasicConfigurator.
21 | */
22 | public class BasicConfigurator {
23 | public static void configure() {
24 | }
25 |
26 | public static void configure(Appender appender) {
27 | }
28 |
29 | public static void resetConfiguration() {
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/ConsoleAppender.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.apache.log4j;
17 |
18 | /**
19 | * Skeleton implementation of ConsoleAppender
20 | */
21 | public class ConsoleAppender extends WriterAppender {
22 |
23 | public ConsoleAppender() {
24 | }
25 |
26 | public ConsoleAppender(Layout layout) {
27 | }
28 |
29 | public ConsoleAppender(Layout layout, String target) {
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/FileAppender.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.apache.log4j;
17 |
18 | public class FileAppender extends WriterAppender {
19 |
20 | public FileAppender() {
21 | }
22 |
23 | public FileAppender(Layout layout, String filename) {
24 | }
25 |
26 | public FileAppender(Layout layout, String filename, boolean append) {
27 | }
28 |
29 | public FileAppender(Layout layout, String filename, boolean append, boolean bufferedIO, int bufferSize) {
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/Layout.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | // Contributors: Christian Trutz
18 | package org.apache.log4j;
19 |
20 | /**
21 | * This class is a minimal implementation of the original Log4J class.
22 | *
23 | * @author Christian Trutz
24 | * */
25 | public class Layout {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/MDC.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.apache.log4j;
18 |
19 | import java.util.Hashtable;
20 | import java.util.Map;
21 |
22 | public class MDC {
23 |
24 | public static void put(String key, String value) {
25 | org.slf4j.MDC.put(key, value);
26 | }
27 |
28 | public static void put(String key, Object value) {
29 | if (value != null) {
30 | put(key, value.toString());
31 | } else {
32 | put(key, null);
33 | }
34 | }
35 |
36 | public static Object get(String key) {
37 | return org.slf4j.MDC.get(key);
38 | }
39 |
40 | public static void remove(String key) {
41 | org.slf4j.MDC.remove(key);
42 | }
43 |
44 | public static void clear() {
45 | org.slf4j.MDC.clear();
46 | }
47 |
48 | /**
49 | * This method is not part of the Log4J public API. However it
50 | * has been called by other projects. This method is here temporarily
51 | * until projects who are depending on this method release fixes.
52 | *
53 | * @return a copy of the underlying map returned as a Hashtable
54 | */
55 | @SuppressWarnings({ "rawtypes", "unchecked" })
56 | @Deprecated
57 | public static Hashtable getContext() {
58 | Map map = org.slf4j.MDC.getCopyOfContextMap();
59 |
60 | if (map != null) {
61 | return new Hashtable(map);
62 | } else {
63 | return new Hashtable();
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/PatternLayout.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | // Contributors: Christian Trutz
18 | package org.apache.log4j;
19 |
20 | /**
21 | * This class is a minimal implementation of the original Log4J class.
22 | *
23 | * @author Christian Trutz
24 | * */
25 | public class PatternLayout extends Layout {
26 |
27 | public PatternLayout() {
28 | super();
29 | }
30 |
31 | public PatternLayout(String pattern) {
32 | super();
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/PropertyConfigurator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.apache.log4j;
18 |
19 | import java.net.URL;
20 | import java.util.Properties;
21 |
22 | import org.apache.log4j.spi.Configurator;
23 | import org.apache.log4j.spi.LoggerRepository;
24 |
25 | /**
26 | * A no-op implementation of PropertyConfigurator.
27 | */
28 | public class PropertyConfigurator implements Configurator {
29 | public static void configure(Properties properties) {
30 | }
31 |
32 | public static void configure(String configFilename) {
33 | }
34 |
35 | public static void configure(java.net.URL configURL) {
36 | }
37 |
38 | public static void configureAndWatch(String configFilename) {
39 | }
40 |
41 | public static void configureAndWatch(String configFilename, long delay) {
42 | }
43 |
44 | public void doConfigure(Properties properties, LoggerRepository hierarchy) {
45 | }
46 |
47 | public void doConfigure(String configFileName, LoggerRepository hierarchy) {
48 | }
49 |
50 | public void doConfigure(URL configURL, LoggerRepository hierarchy) {
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/RollingFileAppender.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | // Contributors: Christian Trutz
18 | package org.apache.log4j;
19 |
20 | import java.io.IOException;
21 |
22 | /**
23 | * This class is a minimal implementation of the original Log4J class.
24 | *
25 | * @author Christian Trutz
26 | * */
27 | public class RollingFileAppender {
28 |
29 | public RollingFileAppender() {
30 | super();
31 | }
32 |
33 | public RollingFileAppender(Layout layout, String filename) throws IOException {
34 | super();
35 | }
36 |
37 | public RollingFileAppender(Layout layout, String filename, boolean append) throws IOException {
38 | super();
39 | }
40 |
41 | public void setMaxBackupIndex(int maxBackups) {
42 | // nothing to do
43 | }
44 |
45 | public void setMaximumFileSize(long maxFileSize) {
46 | // nothing to do
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/SimpleLayout.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.apache.log4j;
17 |
18 | public class SimpleLayout extends Layout {
19 | }
20 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/WriterAppender.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.apache.log4j;
17 |
18 | public class WriterAppender extends AppenderSkeleton {
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/helpers/NullEnumeration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.log4j.helpers;
19 |
20 | import java.util.Enumeration;
21 | import java.util.NoSuchElementException;
22 |
23 | /**
24 | * An always-empty Enumerator.
25 | *
26 | * @author Anders Kristensen
27 | * @since version 1.0
28 | */
29 | @SuppressWarnings("rawtypes")
30 | public class NullEnumeration implements Enumeration {
31 | private static final NullEnumeration instance = new NullEnumeration();
32 |
33 | private NullEnumeration() {
34 | }
35 |
36 | public static NullEnumeration getInstance() {
37 | return instance;
38 | }
39 |
40 | public boolean hasMoreElements() {
41 | return false;
42 | }
43 |
44 | public Object nextElement() {
45 | throw new NoSuchElementException();
46 | }
47 | }
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
An rather minimal but sufficient implementation redirecting all
13 | calls to a log4j logger to a logback logger.
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/spi/Configurator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.apache.log4j.spi;
18 |
19 | import java.net.URL;
20 |
21 | /**
22 | Implemented by classes capable of configuring log4j using a URL.
23 |
24 | @since 1.0
25 | @author Anders Kristensen
26 | */
27 | public interface Configurator {
28 |
29 | /**
30 | Special level value signifying inherited behaviour. The current
31 | value of this string constant is inherited. {@link #NULL}
32 | is a synonym. */
33 | public static final String INHERITED = "inherited";
34 |
35 | /**
36 | Special level signifying inherited behaviour, same as {@link
37 | #INHERITED}. The current value of this string constant is
38 | null. */
39 | public static final String NULL = "null";
40 |
41 | /**
42 | Interpret a resource pointed by a URL and set up log4j accordingly.
43 |
44 | The configuration is done relative to the hierarchy
45 | parameter.
46 |
47 | @param url The URL to parse
48 | @param repository The hierarchy to operation upon.
49 | */
50 | void doConfigure(URL url, LoggerRepository repository);
51 | }
52 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/spi/ErrorHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.apache.log4j.spi;
18 |
19 | /**
20 | * Created by IntelliJ IDEA.
21 | * User: ceki
22 | * Date: 19 oct. 2010
23 | * Time: 11:46:24
24 | * To change this template use File | Settings | File Templates.
25 | */
26 | public class ErrorHandler {
27 | }
28 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/spi/Filter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.apache.log4j.spi;
18 |
19 | public class Filter {
20 | }
21 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/spi/HierarchyEventListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.apache.log4j.spi;
18 |
19 | import org.apache.log4j.*;
20 |
21 | /**
22 | Listen to events occurring within a {@link
23 | org.apache.log4j.Hierarchy Hierarchy}.
24 |
25 | @author Ceki Gülcü
26 | @since 1.2
27 |
28 | */
29 | public interface HierarchyEventListener {
30 |
31 | // public
32 | // void categoryCreationEvent(Category cat);
33 |
34 | public void addAppenderEvent(Category cat, Appender appender);
35 |
36 | public void removeAppenderEvent(Category cat, Appender appender);
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/spi/LoggerFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.apache.log4j.spi;
18 |
19 | import org.apache.log4j.Logger;
20 |
21 | /**
22 |
23 | Implement this interface to create new instances of Logger or
24 | a subclass of Logger.
25 |
26 |
See examples/subclass/MyLogger.java for an example.
27 |
28 | @author Ceki Gülcü
29 | @since version 0.8.5
30 |
31 | */
32 | public interface LoggerFactory {
33 |
34 | public Logger makeNewLoggerInstance(String name);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/spi/LoggingEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.apache.log4j.spi;
18 |
19 | public class LoggingEvent {
20 | }
21 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/spi/OptionHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.apache.log4j.spi;
17 |
18 | public interface OptionHandler {
19 |
20 | void activateOptions();
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java/org/apache/log4j/xml/DOMConfigurator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2004 The Apache Software Foundation.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.apache.log4j.xml;
18 |
19 | import org.apache.log4j.spi.Configurator;
20 | import org.apache.log4j.spi.LoggerRepository;
21 |
22 | import javax.xml.parsers.FactoryConfigurationError;
23 | import java.io.InputStream;
24 | import java.io.Reader;
25 | import java.net.URL;
26 | import java.util.Properties;
27 |
28 | import org.w3c.dom.Element;
29 |
30 | public class DOMConfigurator implements Configurator {
31 |
32 | public static void configure(Element element) {
33 | }
34 |
35 | public static void configure(String filename) throws FactoryConfigurationError {
36 | }
37 |
38 | static public void configure(URL url) throws FactoryConfigurationError {
39 | }
40 |
41 | static public void configureAndWatch(String configFilename) {
42 | }
43 |
44 | public static void configureAndWatch(String configFilename, long delay) {
45 | }
46 |
47 | public void doConfigure(Element element, LoggerRepository repository) {
48 | }
49 |
50 | public void doConfigure(InputStream inputStream, LoggerRepository repository) throws FactoryConfigurationError {
51 | }
52 |
53 | public void doConfigure(Reader reader, LoggerRepository repository) throws FactoryConfigurationError {
54 | }
55 |
56 | public void doConfigure(String filename, LoggerRepository repository) {
57 | }
58 |
59 | public void doConfigure(URL url, LoggerRepository repository) {
60 | }
61 |
62 | public static String subst(String value, Properties props) {
63 | return value;
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/main/java9/module-info.java:
--------------------------------------------------------------------------------
1 | module log4j {
2 | requires org.slf4j;
3 | requires java.xml;
4 | exports org.apache.log4j;
5 | exports org.apache.log4j.helpers;
6 | exports org.apache.log4j.spi;
7 | exports org.apache.log4j.xml;
8 | }
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/test/java/org/apache/log4j/test/NDCTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2004-2011 QOS.ch
3 | * All rights reserved.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | *
24 | */
25 | package org.apache.log4j.test;
26 |
27 | import static org.junit.Assert.assertEquals;
28 |
29 | import org.junit.After;
30 | import org.junit.Before;
31 | import org.junit.Test;
32 |
33 | import org.apache.log4j.NDC;
34 |
35 | /**
36 | * @author Ceki Gülcü
37 | */
38 | public class NDCTest {
39 |
40 | @Before
41 | public void setUp() {
42 | assertEquals(0, NDC.getDepth());
43 | }
44 |
45 | @After
46 | public void tearDown() {
47 | NDC.clear();
48 | }
49 |
50 | @Test
51 | public void testSmoke() {
52 | NDC.push("a");
53 | String back = NDC.pop();
54 | assertEquals("a", back);
55 | }
56 |
57 | @Test
58 | public void testPop() {
59 | NDC.push("peek");
60 | String back = NDC.peek();
61 | assertEquals("peek", back);
62 | }
63 |
64 | @Test
65 | public void testClear() {
66 | NDC.push("clear");
67 | NDC.clear();
68 | assertEquals(0, NDC.getDepth());
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/test/java/org/apache/log4j/test/Trivial.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2004-2011 QOS.ch
3 | * All rights reserved.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | *
24 | */
25 | package org.apache.log4j.test;
26 |
27 | import org.apache.log4j.Logger;
28 |
29 | import junit.framework.TestCase;
30 |
31 | public class Trivial extends TestCase {
32 |
33 | public void testSmoke() {
34 | Logger l = Logger.getLogger("a");
35 | l.trace("t");
36 | l.debug("d");
37 | l.info("i");
38 | l.warn("w");
39 | l.error("e");
40 | l.fatal("f");
41 |
42 | Exception e = new Exception("testing");
43 | l.trace("t", e);
44 | l.debug("d", e);
45 | l.info("i", e);
46 | l.warn("w", e);
47 | l.error("e", e);
48 | l.fatal("f", e);
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/log4j-over-slf4j/src/test/java/org/dummy/ListHandler.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2004-2011 QOS.ch
3 | * All rights reserved.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | *
24 | */
25 | package org.dummy;
26 |
27 | import java.util.ArrayList;
28 | import java.util.List;
29 | import java.util.logging.Handler;
30 | import java.util.logging.LogRecord;
31 |
32 | public class ListHandler extends Handler {
33 |
34 | List list = new ArrayList<>();
35 |
36 | public void close() throws SecurityException {
37 |
38 | }
39 |
40 | public void flush() {
41 |
42 | }
43 |
44 | public void publish(LogRecord logRecord) {
45 | logRecord.getSourceClassName();
46 | list.add(logRecord);
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/osgi-over-slf4j/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2004-2022 QOS.ch Sarl (Switzerland)
2 | All rights reserved.
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/osgi-over-slf4j/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | 4.0.0
6 |
7 |
8 | org.slf4j
9 | slf4j-parent
10 | 2.0.18-SNAPSHOT
11 | ../parent/pom.xml
12 |
13 |
14 | osgi-over-slf4j
15 |
16 | jar
17 | OSGi LogService implemented over SLF4J
18 |
19 | http://www.slf4j.org
20 |
21 | OSGi LogService implementation over SLF4J
22 |
23 |
24 |
25 |
26 | org.osgi
27 | org.osgi.core
28 | 4.2.0
29 | provided
30 |
31 |
32 | org.osgi
33 | org.osgi.enterprise
34 | 4.2.0
35 | provided
36 |
37 |
38 |
39 | org.slf4j
40 | slf4j-simple
41 | provided
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | org.apache.felix
50 | maven-bundle-plugin
51 |
52 |
53 | org.slf4j.osgi-over-slf4j
54 | org.slf4j.osgi.logservice.impl.Activator
55 | osgi
56 | <_exportcontents combine.self="override" />
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/release.sh:
--------------------------------------------------------------------------------
1 |
2 | # Javadoc
3 |
4 | #JDK8 - mvn site:site
5 | #rscpSLF4J apidocs/
6 |
7 | # JDK 11+
8 | # adding the following
9 | #mvn -Ddoclint=none -Dadditionalparam=-Xdoclint:none javadoc:aggregate
10 |
11 |
12 | #mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${VERSION_NUMBER}
13 |
14 | MVN='/java/maven-3.5.2//bin/mvn'
15 |
16 | function checkExit(){
17 | if test "$?" != "0"; then
18 | echo Command $1 exited with abnormal status
19 | exit 1;
20 | else echo $?
21 | fi
22 | }
23 |
24 | function echoRunAndCheck () { # echo and then run the command
25 | echo $1
26 | $1
27 | ret=$?
28 | if test "$ret" != "0";
29 | then
30 | echo Failed command: $1
31 | exit 1;
32 | else echo Successful run: $1
33 | fi
34 | }
35 |
36 | echoRunAndCheck "$MVN clean"
37 |
38 | echoRunAndCheck "$MVN install"
39 |
40 | #echoRunAndCheck "$MVN site:site"
41 |
42 | #echoRunAndCheck "$MVN javadoc:aggregate"
43 |
44 | #echoRunAndCheck "$MVN jxr:aggregate"
45 |
46 |
47 | if [ ! -z "$PASS" ]
48 | then
49 | # WARNING deploying without cleaning may leave stale MANIFEST files
50 | export GPG_TTY=$(tty)
51 | echoRunAndCheck "$MVN deploy -P javadocjar,sign-artifacts"
52 | fi
53 |
54 |
55 | git tag -m "tagging" -a v_${VERSION_NUMBER}
56 | git push --tags
57 |
58 | #Update release version and add next version on jira
59 |
60 |
61 |
62 | echo Full Success
63 |
--------------------------------------------------------------------------------
/slf4j-api/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2004-2023 QOS.ch
2 | All rights reserved.
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/slf4j-api/src/main/java/org/slf4j/LoggerFactoryFriend.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2004-2021 QOS.ch
3 | * All rights reserved.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | *
24 | */
25 | package org.slf4j;
26 |
27 | /**
28 | * All methods in this class are reserved for internal use, for testing purposes.
29 | *
30 | *
They can be modified, renamed or removed at any time without notice.
31 | *
32 | *
You are strongly discouraged calling any of the methods of this class.
33 | *
34 | * @since 1.8.0
35 | *
36 | * @author Ceki Gülcü
37 | */
38 | public class LoggerFactoryFriend {
39 |
40 | /*
41 | * Force LoggerFactory to consider itself uninitialized.
42 | */
43 | static public void reset() {
44 | LoggerFactory.reset();
45 | }
46 |
47 | /**
48 | * Set LoggerFactory.DETECT_LOGGER_NAME_MISMATCH variable.
49 | *
50 | * @param enabled a boolean
51 | */
52 | public static void setDetectLoggerNameMismatch(boolean enabled) {
53 | LoggerFactory.DETECT_LOGGER_NAME_MISMATCH = enabled;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/slf4j-api/src/main/java/org/slf4j/event/EventConstants.java:
--------------------------------------------------------------------------------
1 | package org.slf4j.event;
2 |
3 | import org.slf4j.spi.LocationAwareLogger;
4 |
5 | public class EventConstants {
6 | public static final int ERROR_INT = LocationAwareLogger.ERROR_INT;
7 | public static final int WARN_INT = LocationAwareLogger.WARN_INT;
8 | public static final int INFO_INT = LocationAwareLogger.INFO_INT;
9 | public static final int DEBUG_INT = LocationAwareLogger.DEBUG_INT;
10 | public static final int TRACE_INT = LocationAwareLogger.TRACE_INT;
11 | public static final String NA_SUBST = "NA/SubstituteLogger";
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/slf4j-api/src/main/java/org/slf4j/event/KeyValuePair.java:
--------------------------------------------------------------------------------
1 | package org.slf4j.event;
2 |
3 | import java.util.Objects;
4 |
5 | public class KeyValuePair {
6 |
7 | public final String key;
8 | public final Object value;
9 |
10 | public KeyValuePair(String key, Object value) {
11 | this.key = key;
12 | this.value = value;
13 | }
14 |
15 | @Override
16 | public String toString() {
17 | return String.valueOf(key) + "=\"" + String.valueOf(value) +"\"";
18 | }
19 |
20 | @Override
21 | public boolean equals(Object o) {
22 | if(this == o) return true;
23 | if(o == null || getClass() != o.getClass()) return false;
24 | KeyValuePair that = (KeyValuePair) o;
25 | return Objects.equals(key, that.key) && Objects.equals(value, that.value);
26 | }
27 |
28 | @Override
29 | public int hashCode() {
30 | return Objects.hash(key, value);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/slf4j-api/src/main/java/org/slf4j/event/Level.java:
--------------------------------------------------------------------------------
1 | package org.slf4j.event;
2 |
3 | import static org.slf4j.event.EventConstants.DEBUG_INT;
4 | import static org.slf4j.event.EventConstants.ERROR_INT;
5 | import static org.slf4j.event.EventConstants.INFO_INT;
6 | import static org.slf4j.event.EventConstants.TRACE_INT;
7 | import static org.slf4j.event.EventConstants.WARN_INT;
8 |
9 | /**
10 | * SLF4J's internal representation of Level.
11 | *
12 | *
13 | * @author Ceki Gülcü
14 | * @since 1.7.15
15 | */
16 | public enum Level {
17 |
18 | ERROR(ERROR_INT, "ERROR"), WARN(WARN_INT, "WARN"), INFO(INFO_INT, "INFO"), DEBUG(DEBUG_INT, "DEBUG"), TRACE(TRACE_INT, "TRACE");
19 |
20 | private final int levelInt;
21 | private final String levelStr;
22 |
23 | Level(int i, String s) {
24 | levelInt = i;
25 | levelStr = s;
26 | }
27 |
28 | public int toInt() {
29 | return levelInt;
30 | }
31 |
32 | public static Level intToLevel(int levelInt) {
33 | switch (levelInt) {
34 | case (TRACE_INT):
35 | return TRACE;
36 | case (DEBUG_INT):
37 | return DEBUG;
38 | case (INFO_INT):
39 | return INFO;
40 | case (WARN_INT):
41 | return WARN;
42 | case (ERROR_INT):
43 | return ERROR;
44 | default:
45 | throw new IllegalArgumentException("Level integer [" + levelInt + "] not recognized.");
46 | }
47 | }
48 |
49 | /**
50 | * Returns the string representation of this Level.
51 | */
52 | public String toString() {
53 | return levelStr;
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/slf4j-api/src/main/java/org/slf4j/event/LoggingEvent.java:
--------------------------------------------------------------------------------
1 | package org.slf4j.event;
2 |
3 | import java.util.List;
4 |
5 | import org.slf4j.Marker;
6 |
7 | /**
8 | * The minimal interface sufficient for the restitution of data passed
9 | * by the user to the SLF4J API.
10 | *
11 | * @author Ceki Gülcü
12 | * @since 1.7.15
13 | */
14 | public interface LoggingEvent {
15 |
16 | Level getLevel();
17 |
18 | String getLoggerName();
19 |
20 | String getMessage();
21 |
22 | List