You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2010/02/20 17:40:27 UTC

[jira] Created: (LOG4J2-33) Support Annotations

Support Annotations
-------------------

                 Key: LOG4J2-33
                 URL: https://issues.apache.org/jira/browse/LOG4J2-33
             Project: Log4j 2
          Issue Type: New Feature
          Components: API
            Reporter: Ralph Goers
             Fix For: 0.1


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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: [jira] Commented: (LOG4J2-33) Support Annotations

Posted by Ralph Goers <ra...@dslextreme.com>.
On May 14, 2010, at 11:53 PM, Thorbjørn Ravn Andersen wrote:

> Den 15/05/10 08.29, Ralph Goers (JIRA) skrev:
>> My experimental branch uses annotations for Logj components, but still does not address my desire to allow applications to inject logging.
>>   
> Annotations are just meta-information.  You will need the classloader to take special action on them for anything to happen.

That depends if it is a compile time annotation or runtime annotation. With Java 6 compile time annotations can leverage the annotation processor during compilation to do all sorts of interesting things.
 
> 
> I am cracking the nut of how to get "@Inject Logger log" to work properly with slf4j in a JEE 6 setting - I believe it is a case of a correctly placed @Producer.  Is this similar to what you want to solve?


I haven't sat down and spec'd it out but something like:

@Logger Logger logger;

@LogFlow
public class MyClass {

	public void method1(String parm1) {
        ...
        }
}

which would inject the logger and the entry and exit tracing. It would be even better if you could do


	public void method1(String parm1) {
        	...
       		@debug result = callService(parm1);
         }

and have the debug generate a message like "callService with parm1=value returned result n" or "calling callService with parm 1" followed by "callService returned result n".

Unfortunately, I don't believe this is possible since annotations aren't allowed on a statement.

Ralph


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: [jira] Commented: (LOG4J2-33) Support Annotations

Posted by Thorbjørn Ravn Andersen <no...@gmail.com>.
Den 15/05/10 08.29, Ralph Goers (JIRA) skrev:
> My experimental branch uses annotations for Logj components, but still does not address my desire to allow applications to inject logging.
>    
Annotations are just meta-information.  You will need the classloader to 
take special action on them for anything to happen.

I am cracking the nut of how to get "@Inject Logger log" to work 
properly with slf4j in a JEE 6 setting - I believe it is a case of a 
correctly placed @Producer.  Is this similar to what you want to solve?

-- 
   Thorbjørn Ravn Andersen  "...plus... Tubular Bells!"


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


[jira] Commented: (LOG4J2-33) Support Annotations

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4J2-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12867805#action_12867805 ] 

Ralph Goers commented on LOG4J2-33:
-----------------------------------

My experimental branch uses annotations for Logj components, but still does not address my desire to allow applications to inject logging.

> Support Annotations
> -------------------
>
>                 Key: LOG4J2-33
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-33
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: API
>            Reporter: Ralph Goers
>             Fix For: 0.1
>
>
> 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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


[jira] Commented: (LOG4J2-33) Support Annotations

Posted by "Daniele Di Bernardo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4J2-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899541#action_12899541 ] 

Daniele Di Bernardo commented on LOG4J2-33:
-------------------------------------------

An implementation via Java annotations can be found in my meta-library called Loggable. You can find more info at this web page: http://www.marzapower.com/loggable/

I hope that such an implementation could help in the development of log4j v. 2, with full support for Java annotations.

> Support Annotations
> -------------------
>
>                 Key: LOG4J2-33
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-33
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: API
>            Reporter: Ralph Goers
>             Fix For: 0.1
>
>
> 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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org