Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * 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.
  */
 package org.apache.marmotta.platform.core.logging;
 
 
 import java.util.List;

Add file description here!

Author(s):
Sebastian Schaffert (sschaffert@apache.org)
 
 public abstract class BaseLoggingModule implements LoggingModule {
 
     @Inject
 
     @Inject
     protected LoggingService loggingService;

    
Update the currently active (logback) level used by this logging module. This method directly updates the configuration file.

Parameters:
level
 
     @Override
     public void setCurrentLevel(Level level) {
         .setConfiguration(String.format("logging.module.%s.level"getId()), level.toString());
     }

    
Return the currently configured (logback) level used by this logging module. This field is read from the configuration file and defaults to getDefaultLevel()

Returns:
 
     @Override
     public Level getCurrentLevel() {
         return Level.toLevel(.getStringConfiguration(String.format("logging.module.%s.level"getId())), getDefaultLevel());
     }


    
Return the identifiers of all logging outputs configured for this module

Returns:
 
     @Override
     public List<StringgetLoggingOutputIds() {
         return .getListConfiguration(String.format("logging.module.%s.appenders"getId()), Lists.newArrayList("console","main"));
     }

    
Return the logging outputs configured for this module (resolved using the LoggingService).

Returns:
 
     @Override
     public List<LoggingOutputgetLoggingOutputs() {
         return Lists.transform(getLoggingOutputIds(), new Function<StringLoggingOutput>() {
             @Override
             public LoggingOutput apply(String input) {
                 return .getOutputConfiguration(input);
             }
         });
     }

    
Set the identifiers of all logging outputs for this module

Parameters:
ids
 
     @Override
     public void setLoggingOutputIds(List<Stringids) {
         .setListConfiguration(String.format("logging.module.%s.appenders"getId()), ids);
    }

    
Set the logging outputs configured for this module (internally calls setLoggingOutputIds).

Parameters:
outputs
    @Override
    public void setLoggingOutputs(List<LoggingOutputoutputs) {
        setLoggingOutputIds(Lists.transform(outputsnew Function<LoggingOutputString>() {
            @Override
            public String apply(LoggingOutput input) {
                return input.getId();
            }
        }));
    }
New to GrepCode? Check out our FAQ X