Skip to content

How to temporarily disable logging to nornir.log #748

Answered by dmfigol
DarkSplash asked this question in Q&A
Discussion options

You must be logged in to vote

@DarkSplash there is a way by turning off a specific logger that emits a message. Could you show the log message you want to suppress (obviously remove sensitive information yourself)?
generally it would look like this:

logger = logging.getLogger("<logger name, probably netmiko>")
logger.disabled = True
# your task
logger.disabled = False

However, it might worth having a discussion and ask underling library maintainers to remove sensitive information from logs by default? Not sure.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@DarkSplash
Comment options

Answer selected by DarkSplash
Comment options

You must be logged in to vote
1 reply
@DarkSplash
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants