Move to kernel style SPDX license identifiers
[lttng-ust.git] / doc / examples / java-log4j / Hello.java
index a477e334604e2732555222de7ed8452785e07cee..e90c756339e225e48d73db2031f3adf6ce9d994e 100644 (file)
@@ -1,24 +1,9 @@
 /*
- * Copyright (C) 2015 - EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
- * Copyright (C) 2014 - Christian Babeux <christian.babeux@efficios.com>
+ * SPDX-License-Identifier: MIT
  *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * Copyright (C) 2015 EfficiOS Inc.
+ * Copyright (C) 2015 Alexandre Montplaisir <alexmonthy@efficios.com>
+ * Copyright (C) 2014 Christian Babeux <christian.babeux@efficios.com>
  */
 
 import java.io.IOException;
@@ -26,6 +11,7 @@ import java.io.IOException;
 import org.apache.log4j.Appender;
 import org.apache.log4j.BasicConfigurator;
 import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
 import org.lttng.ust.agent.log4j.LttngLogAppender;
 
 /**
@@ -64,6 +50,17 @@ public class Hello {
         *             command line.
         */
        public static void main(String args[]) throws IOException {
+
+               /*
+                * Set lowest level to make sure all event levels are logged.
+                * Any jar can override the default log4j rootLogger level
+                * and a logger with no explicit level defaults to the non-null
+                * parent level. Events could be ignored if the inherited value
+                * is to low.
+                * e.g BSF  -> https://issues.apache.org/jira/browse/BSF-24
+                */
+               HELLO_LOG.setLevel(Level.ALL);
+
                /* Start with the default Log4j configuration, which logs to console */
                BasicConfigurator.configure();
 
This page took 0.023414 seconds and 4 git commands to generate.