cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

How to reduce the stack trace logging ?

berny2U
13-Aquamarine

How to reduce the stack trace logging ?

Hi
At times we seem to have huge log files. Apparently some more or less innocent errors are logged with their full stack trace of executed java methods, Sometimes more than 100 lines long for a single occurance.
Is there a way to only display the top methods in the stack trace ?

berny2U_0-1669729692959.png

 

ACCEPTED SOLUTION

Accepted Solutions
TomU
23-Emerald IV
(To:berny2U)

Maybe someone on the community has a workaround, but the official response I've gotten from tech support is 'no'.  I went round and round with them, but they couldn't provide a solution.  I too have no need to see hundreds of lines of stack trace errors when a user is properly blocked from doing something they don't have permissions to do.  (Trying to check out something at a released state, check in something to locked library, etc.)  The system working 'properly' should not be generating thousands of lines of stack trace errors to the logs every day. 

View solution in original post

2 REPLIES 2
TomU
23-Emerald IV
(To:berny2U)

Maybe someone on the community has a workaround, but the official response I've gotten from tech support is 'no'.  I went round and round with them, but they couldn't provide a solution.  I too have no need to see hundreds of lines of stack trace errors when a user is properly blocked from doing something they don't have permissions to do.  (Trying to check out something at a released state, check in something to locked library, etc.)  The system working 'properly' should not be generating thousands of lines of stack trace errors to the logs every day. 

TomU
23-Emerald IV
(To:TomU)

Here is some of the back and forth I had with tech support in the past on this issue:

 

Me:

 

In my opinion, unless someone explicitly turns on additional logging levels (debug, trace, etc.), there should *NEVER* be stack traces dumped to the logs.  Just log the error and move on.  There are a plethora of different errors that currently cause full stack traces to be dumped to the logs and rarely is anything more than just the initial message necessary (except maybe for the developers.)

 

Examples

  • Operation failed because the user did not have the necessary permission
  • ReferentialIntegrityException
  • VersionControlException / UniquenessException
  • AddToWorkspaceAction - … user did not have the necessary permission …

 

Me:

 

Here is another really good example of an unnecessary stack trace.  265 lines just to say the name is already in use.

 

ERROR [ajp-nio-127.0.0.1-8010-exec-171] com.ptc.windchill.uwgm.proesrv.saveas.SaveAsExecutor leiqm - SaveAsExecutor.saveAs ::

wt.vc.VersionControlException: wt.util.WTException: wt.pom.UniquenessException: CAD Part  - 001.prt is not unique.

Nested exception is: wt.pom.UniquenessException: CAD Part  - 001.prt is not unique.

Nested exception is: wt.util.WTException: wt.pom.UniquenessException: CAD Part  - 001.prt is not unique.

Nested exception is: wt.pom.UniquenessException: CAD Part  - 001.prt is not unique.

                at wt.fc.StandardIdentityService.storeSemanticKeys(StandardIdentityService.java:446)

 

Tech Support:

 

The stack trace you refer to will be logged by default since it mentions the classes where the error occurs. This is an expected behavior.

Me:

 

265 lines just to say a file name is already in use?!?!  This might be expected by developers during development but I would argue it’s not expected or desired by the people who are actually maintaining the system.  Sure, log that the file name already exists, but don’t log all the Java errors it took for Windchill to figure that out.

 

Tech Support:

 

... after thorough internal investigation it was determined that this type of stack-tracing and logging is an expected behavior and there is currently no functionality available that could reduce the stack tracing without eliminating other important information from the log.

 

Reason for Closure:  Working as designed

Case Closure Details:  Use case is not achievable with OOTB functionality

Announcements

Top Tags