On Tue, Nov 18, 2008 at 7:30 PM, Thorbjørn Ravn Andersen <span dir="ltr">&lt;<a href="mailto:ravn@runjva.com">ravn@runjva.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Robert Elliot skrev:<br>
<div class="Ih2E3d">&gt; Thanks - I checked the slf4j-ext project when I started, but not the Subversion repository. &nbsp;I presume this is a post-compile step rather than runtime byte code alteration?<br>
&gt;<br>
&gt;<br>
</div>(I got the strange feeling of already having answered this, but I&#39;m not<br>
sure, so I&#39;ll just do it again :)<br>
<br>
Nope. Runs at class load time (i.e. at runtime).<br>
<br>
Please look into the XLogger for actually doing the logging, as it is<br>
intended to allow keeping the information instead of flattening it into<br>
a string (you might want to be able to process this with a tool).<br>
<div class="Ih2E3d">&gt; 1) something like a PatternLayout to allow the user to choose the format of the messages at runtime (I prefer single &gt; to double &gt;&gt; for instance on method entry - petty, but I feel it should be up to the user! &nbsp;And it&#39;s nice to be able to truncate parameter or return values if they are going to be utterly huge)<br>

&gt;<br>
&gt;<br>
</div>Would be nice. &nbsp;Also if it respects a different rendering than just the<br>
normal toString() approach.<br>
<div class="Ih2E3d"><br>
<br>
&gt; 2) trace logging of field value changes so you get output like this:<br>
&gt; fieldName initialValue -&gt; newValue<br>
&gt;<br>
</div>Nice :)<br>
<div class="Ih2E3d"><br>
<br>
&gt; 3) loggers named after the class and method / field name, so you can be more fine grained in what output you get<br>
&gt;<br>
</div>Actually this is something I&#39;ve noticed that java.util.logging can do -<br>
determine the method name of the caller - without any help. &nbsp;Perhaps<br>
this should be the approach? &nbsp;Let the logger do it?<br>
<div class="Ih2E3d"><br>
<br>
&gt; 4) passing the stacktrace to the output (depending on how you configure the pattern) so that if you are interested in what it was that changed the field or called the method you don&#39;t need trace logging on for the entire application<br>

&gt;<br>
&gt;<br>
</div>When you say stack trace, you talk about the call stack? &nbsp;I.e. asking<br>
the JVM for the stack and rendering it, instead of carrying an exception<br>
around? &nbsp;Just to get matters straight.<br>
<br>
This is a really neat idea, which might also work well with the Eclipse<br>
Console plugin.<br>
<br>
I cannot count the times I&#39;ve pasted a stack trace in the Java Stack<br>
Trace pane on the Console to be able to navigate.</blockquote><div><br>I am not sure we&#39;re talking about the same thing, but have you heard of JumpToCode ?<br>It&#39;s a plugin for IntelliJ IDEA that listens for &quot;jump to this code&quot; commands from external programs.<br>
Creating a similar plugin for eclipse is on my TODO list.<br><br>The idea is that log-viewers such as Vigilog and Chainsaw show hyperlinks for every LocationInfo.<br>When hyperlink is clicked a &quot;jump to code&quot; command is sent to your IDE, which will navigate to the corresponding code.<br>
&nbsp;<br>This is already implemented in Vigilog.&nbsp; I still have to ask the chainsaw maintainers to see if they are also interested.<br><br>Maarten<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<div class="Ih2E3d"><br>
&gt; 5) an @Secure annotation to allow the programmer to mark a parameter or return value as something that should not be accessible via trace logging - e.g. a password<br>
&gt;<br>
&gt;<br>
</div>Hmmmm.... &nbsp;I&#39;m not sure of that. &nbsp;Lets see how it works out.<br>
<div class="Ih2E3d"><br>
<br>
&gt; Out of curiousity (not criticising!) what was the reason for picking javassist rather than aspectj?<br>
&gt;<br>
&gt;<br>
</div>It worked :)<br>
<div class="Ih2E3d"><br>
<br>
--<br>
 &nbsp;Thorbjørn Ravn Andersen &nbsp;&quot;...plus... Tubular Bells!&quot;<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="Wj3C7c">logback-dev mailing list<br>
logback-dev@qos.ch<br>
<a href="http://qos.ch/mailman/listinfo/logback-dev" target="_blank">http://qos.ch/mailman/listinfo/logback-dev</a><br>
</div></div></blockquote></div><br>