Skip to content

Commit

Permalink
fabric8io#85: Use log4j logging over the fucking JUL
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus authored and Jenkins committed Nov 27, 2014
1 parent a9d5aad commit 10154cd
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 29 deletions.
2 changes: 1 addition & 1 deletion jube/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>

Expand Down
6 changes: 0 additions & 6 deletions jube/src/main/java/io/fabric8/jube/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@
*/
public final class Main {

private static final String JUBE_VERSION = System.getenv("JUBE_VERSION") != null ? System.getenv("JUBE_VERSION") : "LATEST";
private static final String FABRIC8_VERSION = System.getenv("FABRIC8_VERSION") != null ? System.getenv("FABRIC8E_VERSION") : "LATEST";

private static final String JUL_LOGGING_FORMAT = "%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s %2$s %5$s%6$s%n";

private static final String LOGO =
"\t________ ______\n" +
"\t______(_)____ _____ /_ _____\n" +
Expand All @@ -70,7 +65,6 @@ public static void main(final String[] args) throws Exception {
try {
System.setProperty("hawtio.authenticationEnabled", "false");
System.setProperty("org.eclipse.jetty.util.log.class", Slf4jLog.class.getName());
System.setProperty("java.util.logging.SimpleFormatter.format", JUL_LOGGING_FORMAT);
String port = Systems.getEnvVarOrSystemProperty("HTTP_PORT", "HTTP_PORT", "8585");
Integer portNumber = Integer.parseInt(port);

Expand Down
40 changes: 40 additions & 0 deletions jube/src/main/resources/log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Copyright 2005-2014 Red Hat, Inc.
#
# Red Hat 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.
#

#
# The logging properties
#
log4j.rootLogger=INFO, file, out

#log4j.logger.io.fabric8=DEBUG

# CONSOLE appender not used by default
log4j.appender.out=org.apache.log4j.ConsoleAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
# MDC
#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{breadcrumbId} - %-10.10X{exchangeId} - %-10.10X{correlationId} - %-10.10X{routeId} - %m%n

# File appender
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.file=logs/container.log
log4j.appender.file.append=true
log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
# MDC
#log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{breadcrumbId} - %-10.10X{exchangeId} - %-10.10X{correlationId} - %-10.10X{routeId} - %m%n

log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer
22 changes: 0 additions & 22 deletions jube/src/main/resources/logging.properties

This file was deleted.

0 comments on commit 10154cd

Please sign in to comment.