[ 
https://issues.apache.org/jira/browse/LOG4J2-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15146314#comment-15146314
 ] 

Bruce Brouwer commented on LOG4J2-33:
-------------------------------------

Those are all very good options to have. 

I'm not particularly in favor of the name {{@LogFlow}}. It isn't implicitly 
obvious to me what it does. Does it describe the flow of logs to different 
appenders? Does it control how quickly log events flow to their appenders? I 
would prefer {{@LogEntryExit}} or maybe {{@LogMethodTrace}}. 

I'd like to see options work something like this:
{code}
private static import org.apache.logging.log4j.annotations.Visibility.*;

@LogMethodTrace({PUBLIC, PROTECTED}, arguments=true, parameterNames=true, 
parameterTypes=true, returnValue=true, returnType=true, entry=true, exit=true)
public class SomeApis {
   private int foo() { ... }
   ...
}
{code}

The default parameter is a {{Visibility}} enum, somewhat similar to 
{{java.lang.reflect.Modifier}} which isn't actually an enum. 

The various {{parameters*}} and {{return*}} options would all default to 
{{false}} in my opinion. I have seen plenty of Hibernate entities written with 
a {{toString}} method that causes child entities to load. I'd hate to cause 
huge performance problems from someone quickly slapping this annotation on a 
class without much thought. 

{{entry}} and {{exit}} would default to {{true}}, I'm sure. 

Or maybe I'm adding way to many options.

> Support Annotations
> -------------------
>
>                 Key: LOG4J2-33
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-33
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: API
>    Affects Versions: 2.0-rc2
>            Reporter: Ralph Goers
>             Fix For: 0.1, 2.3
>
>         Attachments: 0001-Add-Loggable.patch
>
>
> The Log4j API should support using annotations as provided in Java 6 so 
> applications can use them instead of calls to logger APIs. This is especially 
> useful for entering & exiting type of events, but could be used wherever 
> annotations are allowed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to