/** * Copyright (c) 2012 - 2018 Data In Motion and others. * All rights reserved. * * This program and the accompanying materials are made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Data In Motion - initial API and implementation */ package org.gecko.logging.sample; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.logging.log4j.LogManager; import org.osgi.service.component.annotations.*; import org.osgi.service.log.LoggerFactory; @Component public class Example { @Reference(service = LoggerFactory.class) private org.osgi.service.log.Logger osgiLogger; private final Logger logger = Logger.getLogger(Example.class.getName()); private final org.slf4j.Logger slfLogger = org.slf4j.LoggerFactory.getLogger(Example.class); private final org.apache.logging.log4j.Logger logLogger = LogManager.getLogger(Example.class); @Activate public void activate() { logger.log(Level.INFO, "Log Example JUL"); slfLogger.info("Log Example SLF4J"); logLogger.info("Log Example Log4J"); osgiLogger.info("Log Example OSGi"); } }