org.wso2.carbon.utils.logging
Class LoggingUtils

java.lang.Object
  extended by org.wso2.carbon.utils.logging.LoggingUtils

public class LoggingUtils
extends Object


Constructor Summary
LoggingUtils()
           
 
Method Summary
static org.apache.log4j.spi.LoggingEvent getLogEvent(LogRecord record)
          Return a logging event from the given log record
static org.apache.log4j.Level getLogLevel(Level level)
          Return the org.apache.log4j.Level from the given java.util.logging.Level
static TenantAwareLoggingEvent getTenantAwareLogEvent(org.apache.log4j.spi.LoggingEvent loggingEvent, int tenantId, String serviceName)
          Returns a TenantAwareLoggingEvent that wraps the LoggingEvent with tenant specific tenantId and serviceName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingUtils

public LoggingUtils()
Method Detail

getLogEvent

public static org.apache.log4j.spi.LoggingEvent getLogEvent(LogRecord record)
Return a logging event from the given log record

Parameters:
record - - the log record
Returns:
- a LoggingEvent

getTenantAwareLogEvent

public static TenantAwareLoggingEvent getTenantAwareLogEvent(org.apache.log4j.spi.LoggingEvent loggingEvent,
                                                             int tenantId,
                                                             String serviceName)
Returns a TenantAwareLoggingEvent that wraps the LoggingEvent with tenant specific tenantId and serviceName

Parameters:
loggingEvent - - The LoggingEvent with the log content
tenantId - - tenant Id of the tenant which triggered log event
serviceName - - service name of the current log event
Returns:
a TenantAwareLoggingEvent

getLogLevel

public static org.apache.log4j.Level getLogLevel(Level level)
Return the org.apache.log4j.Level from the given java.util.logging.Level

Parameters:
level - - the java.util.logging.Level
Returns:
- an org.apache.log4j.Level


Copyright © 2014 WSO2 Inc. All rights reserved.