Skip to main content

Posts

Showing posts with the label log

Preventing Java from printing the stack trace on certain exceptions

I have a security class that throws an AccessDeniedException on a user not being authorized for a certain operation. I made it even neat and put a msg in there with the info I need. The problem is that now my logs are full of stack traces for every single time I throw. I don't care to see the stack trace for THIS exception, and the stack traces are bloating my logs. Is there a way to tell Java not to print the stack trace to the logs if it's this exception? Thanks! -- llappall