Package org.apache.log

Examples of org.apache.log.ContextMap


     * @param format ancilliary format parameter - allowed to be null
     * @return the formatted string
     */
    private String getMethod( final LogEvent event, final String format )
    {
        final ContextMap map = event.getContextMap();
        if( null != map )
        {
            final Object object = map.get( "method" );
            if( null != object )
            {
                return object.toString();
            }
        }
View Full Code Here


     * @param format ancilliary format parameter - allowed to be null
     * @return the formatted string
     */
    private String getThread( final LogEvent event, final String format )
    {
        final ContextMap map = event.getContextMap();
        if( null != map )
        {
            final Object object = map.get( "thread" );
            if( null != object )
            {
                return object.toString();
            }
        }
View Full Code Here

    /**
     * Create a LogFactor record from a LogKit event
     */
    public LogKitLogRecord( final LogEvent event, final Formatter fmt )
    {
        final ContextMap contextMap = event.getContextMap();

        Object contextObject;

        // Category
        setCategory( event.getCategory() );

        // Level
        setLevel( toLogLevel( event.getPriority() ) );
        m_severe = event.getPriority().isGreater( Priority.INFO );

        // Location
        if( null != contextMap && null != ( contextObject = contextMap.get( "method" ) ) )
        {
            setLocation( contextObject.toString() );
        }
        else
        {
            setLocation( StackIntrospector.getCallerMethod( Logger.class ) );
        }

        // Message
        setMessage( event.getMessage() );

        // Millis
        setMillis( event.getTime() );

        // NDC
        setNDC( fmt.format( event ) );

        // SequenceNumber
        //setSequenceNumber( 0L );

        // ThreadDescription
        if( null != contextMap && null != ( contextObject = contextMap.get( "thread" ) ) )
        {
            setThreadDescription( contextObject.toString() );
        }
        else
        {
View Full Code Here

     * @param event the event
     * @return the formatted string
     */
    private String getMethod( final LogEvent event )
    {
        final ContextMap map = event.getContextMap();
        if( null != map )
        {
            final Object object = map.get( "method" );
            if( null != object )
            {
                return object.toString();
            }
        }
View Full Code Here

     * @param event the even
     * @return the formatted string
     */
    private String getThread( final LogEvent event )
    {
        final ContextMap map = event.getContextMap();
        if( null != map )
        {
            final Object object = map.get( "thread" );
            if( null != object )
            {
                return object.toString();
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.log.ContextMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.