------ Extend Onami Logging ------ The Apache Onami Team ------ 2012 ~~ ~~ 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. ~~ Extend Apache Onami Logging Exigent users that have the need to integrate not already supported logging framework, can easily do it by following the listed steps: [[1]] add the <<>> dependency in the <<>>: +--------------------------------------+ org.apache.onami.logging onami-logging-core ${project.version} compile +--------------------------------------+ [[2]] Extend the <<>>, that's the class responsibile of creating and injecting the desired Logger, specifying the Logger type: +--------------------------------------+ import java.lang.reflect.Field; import com.acme.MyLogger; import com.acme.MyLoggerFactory; import org.apache.onami.logging.core.AbstractLoggerInjector; public final class AcmeLoggerInjector extends AbstractLoggerInjector { public AcmeLoggerInjector( Field field ) { super( field ); } @Override protected MyLogger createLogger( Class klass ) { return MyLoggerFactory.getLog( klass ); } } +--------------------------------------+ [[3]] Extend the <<>>, specifying the Logger type and the <<>> type: +--------------------------------------+ import com.acme.MyLogger; import org.apache.onami.logging.core.AbstractLoggingModule; import com.google.inject.TypeLiteral; import com.google.inject.matcher.Matcher; public final class AcmeLoggingModule extends AbstractLoggingModule { public ACLLoggingModule( Matcher> matcher ) { super(matcher, AcmeLoggerInjector.class); } } +--------------------------------------+ [[4]] Plug your new logging module and enjoy ;)