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.api.logging;
 
 
 import java.util.List;

An implementation of a LoggingModule provides information about a component for which to provide logging facilities. It is an abstraction from the "logging by package" concept used by lower-level logging frameworks. A user can select to change the logging configuration for a module, resulting in all packages managed by this module to be logged according to the new configuration. This allows to group packages together that conceptually belong together.

LoggingModule providers are injected by the LoggingService using CDI injection. As such they should be proper CDI bearns and probably live in application scope.

Author(s):
Sebastian Schaffert (sschaffert@apache.org)
 
 public interface LoggingModule {


    
Return a unique identifier for this logging module. This identifier will e.g. be used in the configuration file to store the configuration for this module. For this reason it should only consist of alpha-numeric characters plus _ and _.

Returns:
a unique identifier for the module, suitable for use in the configuration file
 
     public String getId();


    
Return a human-readable name for this logging module. This name is used for displaying information about the module to the user, e.g. in a configuration interface.

Returns:
a human-readable name for the module, suitable for displaying in a user interface
 
     public String getName();


    
Return a collection of packages covered by this logging module. This method should be used to group together those packages that conceptually make up the functionality described by the logging module (e.g. "SPARQL").

Returns:
a collection of package names
 
     public Collection<StringgetPackages();


    
Return the default (logback) level used by this logging module. Should in most cases be INFO or WARN.

Returns:
 
     public Level getDefaultLevel();


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

Returns:
 
     public Level getCurrentLevel();


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

Parameters:
level
 
     public void setCurrentLevel(Level level);


    
Return the identifiers of all logging outputs configured for this module

Returns:
 
     public List<StringgetLoggingOutputIds();


    
Set the identifiers of all logging outputs for this module

Parameters:
ids
    public void setLoggingOutputIds(List<Stringids);

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

Returns:
    public List<LoggingOutputgetLoggingOutputs();


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

Parameters:
outputs
    public void setLoggingOutputs(List<LoggingOutputoutputs);
New to GrepCode? Check out our FAQ X