You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Nicko Cadell (JIRA)" <ji...@apache.org> on 2005/03/01 00:10:48 UTC
[jira] Created: (LOG4NET-10) Add %v pattern to output assembly version
Add %v pattern to output assembly version
-----------------------------------------
Key: LOG4NET-10
URL: http://issues.apache.org/jira/browse/LOG4NET-10
Project: Log4net
Type: New Feature
Components: Core
Versions: 1.2.9
Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
Reporter: Nicko Cadell
n an environment where multiple versions of the same
assembly is being used simultaneously by different
applications, it's very useful to get the version of
the assembly that is emiting the logging event.
I'll add this right away. If you want the (rather
trivial) code, I can post it.
Daniel Cazzulino
---
Well, the code is not trivial (to implement in a performant
way), and our project is a little time-constrained.
If I can, I'll try to make it, most probably in the
LogManager.GetLogger method (the usage pattern indicates
this will probably be a single static call per-class using
logging)... I don't know.
Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (LOG4NET-10) Add %v pattern to output assembly
version
Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-10?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ron Grabowski updated LOG4NET-10:
---------------------------------
Fix Version/s: 1.2.11
Assignee: Ron Grabowski
Affects Version/s: 1.2.10
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: https://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.2.9, 1.2.10
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
> Assignee: Ron Grabowski
> Priority: Minor
> Fix For: 1.2.11
>
> Attachments: asm-ver-desc-patterns.patch
>
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LOG4NET-10) Add %v pattern to output assembly
version
Posted by "Johannes (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617392#action_12617392 ]
Johannes commented on LOG4NET-10:
---------------------------------
Hi,
thx for the enhancement on log4net. I really need this. Can someone explain me how I can install this patch-file, please?
When will the version 1.2.11 be released?
thx in advance.
cheers
jasonx
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: https://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.2.9, 1.2.10
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
> Assignee: Ron Grabowski
> Priority: Minor
> Fix For: 1.2.11
>
> Attachments: asm-patterns.patch, asm-ver-desc-patterns.patch
>
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LOG4NET-10) Add %v pattern to output assembly
version
Posted by "Mark Mitchell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-10?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Mitchell updated LOG4NET-10:
---------------------------------
Attachment: log4net.dll
The attached DLL file has the latest patch file I've uploaded applied.
Normally to apply a patch file you just check out the SVN revision specified of the project, and use svn's apply patch mechanism. This will apply the modified/patched code. You can then build the project to receive the benefits of the patch.
-Mark
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: https://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.2.9, 1.2.10
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
> Assignee: Ron Grabowski
> Priority: Minor
> Fix For: 1.2.11
>
> Attachments: asm-patterns.patch, asm-ver-desc-patterns.patch, log4net.dll
>
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LOG4NET-10) Add %v pattern to output assembly
version
Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625174#action_12625174 ]
Ron Grabowski commented on LOG4NET-10:
--------------------------------------
Mark, I looked at your patch and started writing some test cases and realized that you added support for storing assembly information about the repository. I think what Daniel and Nicko were talking about was wanting to add assembly information from where the log event was generated. For example:
log.Info("Hello World");
What version of the Company.BusinessLayer assembly did that come from?
Company.BusinessLayer, Version=1.2.3.4, Culture=neutral, PublicKeyToken=null
Company.BusinessLayer, Version=1.2.3.5, Culture=neutral, PublicKeyToken=null
Daniel's suggestion about "a single static call per-class using logging" seems to hint that when the first logging event is generated from the class we capture information from the calling assembly. In other words, I think they're suggesting we add an Assembly property to one of the log classes (i.e. LogImpl) instead of (or in addition to) ILoggerRepository. If that's the case we'd need a way to differenciate the %asm pattern being assembly information about the repository vs. assembly information about the calling code.
Does that make sense?
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: https://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.2.9, 1.2.10
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
> Assignee: Ron Grabowski
> Priority: Minor
> Fix For: 1.2.11
>
> Attachments: asm-patterns.patch, asm-ver-desc-patterns.patch, log4net.dll
>
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LOG4NET-10) Add %v pattern to output assembly
version
Posted by "Mark Mitchell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-10?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Mitchell updated LOG4NET-10:
---------------------------------
Attachment: asm-patterns.patch
Should be applied to Revsion 675697
Implements all attributes described in Ron's comment, except with the syntax
%asm{Version}
%asm{Title}
%asm{Trademark}
%asm{Description}
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: https://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.2.9, 1.2.10
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
> Assignee: Ron Grabowski
> Priority: Minor
> Fix For: 1.2.11
>
> Attachments: asm-patterns.patch, asm-ver-desc-patterns.patch
>
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LOG4NET-10) Add %v pattern to output assembly
version
Posted by "Mark Mitchell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-10?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Mitchell updated LOG4NET-10:
---------------------------------
Attachment: asm-ver-desc-patterns.patch
Note: the patch was produced against revision 489241
Here is potential solution for adding the assembly version to the output. I also included the assembly description attribute, as in our build process we stamp every assembly with the svn revision as part of its version field, and the svn url for its description field. Other assembly patterns useful to people could easily be added.
%asm-ver is the pattern for version
%asm-desc is the pattern for description
The only reason I didn't use %v for the version attribute is because I also added the description attribute.
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: https://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.2.9
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
> Priority: Minor
> Attachments: asm-ver-desc-patterns.patch
>
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LOG4NET-10) Add %v pattern to output assembly version
Posted by "Nicko Cadell (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LOG4NET-10?page=comments#action_59905 ]
Nicko Cadell commented on LOG4NET-10:
-------------------------------------
The one LogManager.GetLogger per class pattern is only a suggestion, a rather string suggestion, but there are certainly a number of projects that don't follow this pattern.
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: http://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Type: New Feature
> Components: Core
> Versions: 1.2.9
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (LOG4NET-10) Add %v pattern to output assembly version
Posted by "Nicko Cadell (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LOG4NET-10?page=all ]
Nicko Cadell updated LOG4NET-10:
--------------------------------
Description:
n an environment where multiple versions of the same
assembly is being used simultaneously by different
applications, it's very useful to get the version of
the assembly that is emiting the logging event.
I'll add this right away. If you want the (rather
trivial) code, I can post it.
Daniel Cazzulino
---
Well, the code is not trivial (to implement in a performant
way), and our project is a little time-constrained.
If I can, I'll try to make it, most probably in the
LogManager.GetLogger method (the usage pattern indicates
this will probably be a single static call per-class using
logging)... I don't know.
Daniel Cazzulino
was:
n an environment where multiple versions of the same
assembly is being used simultaneously by different
applications, it's very useful to get the version of
the assembly that is emiting the logging event.
I'll add this right away. If you want the (rather
trivial) code, I can post it.
Daniel Cazzulino
---
Well, the code is not trivial (to implement in a performant
way), and our project is a little time-constrained.
If I can, I'll try to make it, most probably in the
LogManager.GetLogger method (the usage pattern indicates
this will probably be a single static call per-class using
logging)... I don't know.
Daniel Cazzulino
Priority: Minor (was: Major)
There seems to be low demand for this feature. Changing the priority to Minor.
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: http://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Type: New Feature
> Components: Core
> Versions: 1.2.9
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
> Priority: Minor
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (LOG4NET-10) Add %v pattern to output assembly
version
Posted by "Mark Mitchell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625958#action_12625958 ]
Mark Mitchell commented on LOG4NET-10:
--------------------------------------
Ron,
You are right -- I added the assembly information about the logging repository. I think adding the assembly information about the calling code is the goal, but may not be simple to implement in an efficient way.
The reason I implemented the assembly information about the repository is to support the following use case (which I think covers most of the uses of this type of feature):
public class X {
private static final ILog logger = LogManager.getLogger(typeof(X));
...
}
Whenever the logger in the example above calls a log method, the assembly information I store in the logger repository is the same as the assembly for class X, and thus whenever logger outputs log messages, the proper assembly information from it is displayed. The information does not need to be dynamically found for every log call, but is properly setup in the LogManager.getLogger(typeof(X)) method, only the first time.
The area where this will not work is if users do not use the pattern of one logger per class or use named loggers. However, I think enough people use the one logger per class mechanism that it might warrant having two approaches, especially since this way is probably going to be *much* faster than dynamically determining the calling assembly for *every* logging statement.
Thoughts?
-Mark
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: https://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.2.9, 1.2.10
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
> Assignee: Ron Grabowski
> Priority: Minor
> Fix For: 1.2.11
>
> Attachments: asm-patterns.patch, asm-ver-desc-patterns.patch, log4net.dll
>
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (LOG4NET-10) Add %v pattern to output
assembly version
Posted by "Johannes (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617392#action_12617392 ]
jasonx edited comment on LOG4NET-10 at 7/28/08 2:16 AM:
----------------------------------------------------------
Hi,
thx for the enhancement on log4net. I really need this. Can someone explain me how I can install this patch-file, please?
When will the version 1.2.11 be released?
thx in advance.
cheers
Johannes
was (Author: jasonx):
Hi,
thx for the enhancement on log4net. I really need this. Can someone explain me how I can install this patch-file, please?
When will the version 1.2.11 be released?
thx in advance.
cheers
jasonx
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: https://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.2.9, 1.2.10
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
> Assignee: Ron Grabowski
> Priority: Minor
> Fix For: 1.2.11
>
> Attachments: asm-patterns.patch, asm-ver-desc-patterns.patch
>
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LOG4NET-10) Add %v pattern to output assembly
version
Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474353 ]
Ron Grabowski commented on LOG4NET-10:
--------------------------------------
We should probably expose all the Assembly attributes:
%v{Description}
%v{Title}
%v{Version}
%v{Trademark}
...
> Add %v pattern to output assembly version
> -----------------------------------------
>
> Key: LOG4NET-10
> URL: https://issues.apache.org/jira/browse/LOG4NET-10
> Project: Log4net
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.2.9
> Environment: From sourceforege - 775175 - Daniel Cazzulino (kzu) - dcazzulino
> Reporter: Nicko Cadell
> Priority: Minor
> Attachments: asm-ver-desc-patterns.patch
>
>
> n an environment where multiple versions of the same
> assembly is being used simultaneously by different
> applications, it's very useful to get the version of
> the assembly that is emiting the logging event.
> I'll add this right away. If you want the (rather
> trivial) code, I can post it.
> Daniel Cazzulino
> ---
> Well, the code is not trivial (to implement in a performant
> way), and our project is a little time-constrained.
> If I can, I'll try to make it, most probably in the
> LogManager.GetLogger method (the usage pattern indicates
> this will probably be a single static call per-class using
> logging)... I don't know.
> Daniel Cazzulino
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.