[ 
https://issues.apache.org/jira/browse/LOG4J2-737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Remko Popma resolved LOG4J2-737.
--------------------------------

    Resolution: Implemented

Nelson, we just released 2.0.1 and the documentation for custom loggers is 
available on the log4j2 web site under [Custom Log 
Levels|http://logging.apache.org/log4j/2.x/manual/customloglevels.html].

I think that would either give you what you need or be a basis that you can 
start off from.

I'm marking this issue as resolved. Please feel free to re-open if necessary or 
close if you're happy with this solution.

> 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 start of the CustomLogger.entry() method and 
> not the method 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