How to re-establish logging if the listener.log isn’t logging without restarting listener?

For some reason if the listener.log was renamed (mv) or removed and listener will stop logging information to the logfile, one way to fix this issue is to restart the listener but it would require taking an outage. If one can’t restart the listener you can work around this issue by turning off log and turning it back on.

$ rm listener.log
$ touch listener.log
$ ls -l listener.log
-rw-r–r– 1 oracle oinstall 0 Mar 26 18:46 listener.log
$ ORACLE_HOME/bin/lsnrctl
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.01)(PORT=1521)))
LISTENER parameter “log_status” set to OFF
The command completed successfully
LSNRCTL> set log_status on
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
LISTENER parameter “log_status” set to ON
The command completed successfully
LSNRCTL> exit
$ ls -l listener.log
-rw-r–r– 1 oracle oinstall 553 Mar 26 18:53 listener.log

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.