12

I prefer to throw my own exceptions for business logic. For example I have a class com.mine.exception.DuplicateClientException. Is there some configuration where I can turn off printing the stack trace for package com.mine.exception ?

Something like:

logging.level.com.mine.exception=OFF 
0

1 Answer 1

7

In application.properties you can add ‘logging.level.*=LEVEL’ where ‘LEVEL’ is one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF. * is responsible for package/class.

For example

logging.level.root=WARN logging.level.org.springframework.web=DEBUG logging.level.org.hibernate=ERROR 

This means that root logger has WARN level. org.springframework.web is on DEBUG level, but all hibernates files are logged only ERROR.

Sign up to request clarification or add additional context in comments.

1 Comment

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.