Issue Details (XML | Word | Printable)

Key: CONF-7878
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Christopher Owen [Atlassian]
Reporter: Dan Hardiker
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Confluence

Add RenderContext information to exceptions that filter through the Wiki Renderer

Created: 14/Feb/07 12:29 PM   Updated: 09/Mar/07 08:36 AM
Component/s: Administration, Renderer
Affects Version/s: 2.3.3
Fix Version/s: 2.4.2

Time Tracking:
Not Specified

Issue Links:
Reference
 

Participants: Christopher Owen [Atlassian] and Dan Hardiker
Since last comment: 1 year, 37 weeks ago
Resolution Date: 08/Mar/07 05:42 PM
Labels:


 Description  « Hide
Consider the following scenario:
  • You are running a public Confluence installation that contains uncountable uses of {a-macro}
  • One of those instances on a page somewhere is throwing exceptions
  • You didn't trigger the exception and can assume the user didn't report the red "bad macro" they saw on screen.

In the logs all you will see is a stacktrace which ripples from the macro's class through the renderer and beyond. Unfortunately there's no contextual information.

  1. Which ceo ID was this being rendered against? (if any)
  2. Which username was logged in at the time? (if any)

There may be other contextual information, but I would like to get the rendering exceptions (where possible) to give me as much contextual information so I can replicate ... the easiest way I can think of doing that is to catch and rethrow/log the runtime & macro exceptions, but tag on the context to the exception message.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Christopher Owen [Atlassian] added a comment - 04/Mar/07 11:50 PM
Hi Dan,

This is what I have implemented so far

2007-03-05 16:39:15,556 ERROR [tcpConnection-8080-0] [renderer.v2.components.MacroRendererComponent] processMacro Unexpected error formatting macro: exceptionmacro
– url: /display/TST/Home | userName: admin | action: viewpage | page: 753666
java.lang.RuntimeException: An exception at Mon Mar 05 16:39:15 EST 2007
at com.atlassian.confluence.extra.exception.ExceptionMacro.execute(ExceptionMacro.java:27)
at com.atlassian.renderer.macro.RadeoxCompatibilityMacro.execute(RadeoxCompatibilityMacro.java:149)
at com.atlassian.confluence.renderer.v2.macros.RadeoxCompatibilityMacro.execute(RadeoxCompatibilityMacro.java:26)
.....

Note the second line containing some logging context.

Rather than only having this for render exceptions, I've added context logging from the top of the request chain. It will be immensely valuable for our support team as well. This has been implemented using Log4J Mapped Diagnostic Contexts (MDC)

Thoughts? Parseable enough?

Chris


Christopher Owen [Atlassian] added a comment - 08/Mar/07 05:42 PM
Username and URL logged for messages logged below logging context web filter. Action name and CEO id logged for messages logged below logging context xwork interceptor.

They will probably be refinements to this later based on feedback.


Dan Hardiker added a comment - 09/Mar/07 08:35 AM
I have added a new issue which kinda relates to this as its the same issue, but in a different area: CONF-8020