Nelson MELINA created LOG4J2-737:
------------------------------------

             Summary: Is is possible to use the Flow Tracing features without 
giving access to the Log4J2 logger directly to devs ?
                 Key: LOG4J2-737
                 URL: https://issues.apache.org/jira/browse/LOG4J2-737
             Project: Log4j 2
          Issue Type: Question
         Environment: Android
            Reporter: Nelson MELINA
            Priority: Minor


The devs would only have access to a custom made Logging class (this class will 
use Log4J 2.x).


This class would implement something like this :
{code:title=CustomLogger.java|borderStyle=solid}
public interface CustomLogger {

    /**
     * Log an Error event and trigger the action assigned to it.
     *
     * @param name
     * @param level
     * @param type
     * @param timestamp
     * @param stackTraceElement
     * @param walletID
     * @param widgetID
     * @param userID
     * @param contextualData
     * @param customData
     */
    void logErrorEvent(String name, Level level, int type, int timestamp, 
StackTraceElement stackTraceElement,
                              int walletID, int widgetID, int userID, Object 
contextualData, Object customData);

    /**
     * Log a simple Object.
     *
     * @param o
     */
    void logSimpleEvent(Object o);

    /**
     * Log a Business Intelligence Event.
     *
     * @param name
     * @param level
     * @param type
     * @param timestamp
     * @param stackTraceElement
     * @param walletID
     * @param widgetID
     * @param userID
     * @param contextualData
     * @param customData
     */
    void logBIEvent(String name, Level level, int type, int timestamp, 
StackTraceElement stackTraceElement,
                           int walletID, int widgetID, int userID, Object 
contextualData, Object customData);

    /**
     *
     * @param t
     */
    void catching(Throwable t);

    /**
     *
     */
    void entry();

    /**
     *
     * @param params
     */
    void entry(Object... params);

    /**
     *
     * @param result
     */
    void exit(R result);

    /**
     *
     */
    void exit();

    /**
     *
     * @param level
     * @param t
     * @param <T>
     * @return
     */
    <T extends Throwable> T throwing(Level level, Throwable t);

    /**
     *
     * @param t
     * @param <T>
     * @return
     */
    <T extends Throwable> T throwing(T t);
}
{code}

If i understand correctly if in CustomLogger.entry() i use the log4j2 
logger.entry() it'll record the entry of CustomLogger.entry() method and not 
the one calling it.

Is there a way to do what i want in a (not so) simple fashion ?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to