Firebird Question:
How to prevent firebird.log file from filling up the disk partition?
Answer:
Here are some tips:
a) create a scheduled task or cron job that will truncate or rotate the log file. By rotation, we mean renaming the files in such way that you always have a number of previous logs available. Example:
delete firebird.log.5
rename firebird.log.4 firebird.log.5
rename firebird.log.3 firebird.log.4
rename firebird.log.2 firebird.log.3
rename firebird.log.1 firebird.log.2
rename firebird.log firebird.log.1
This way you'll always have last five logs available, and those too old get deleted. You can also use zip, rar, bzip2 or some other packer to compress the old log files. Since they are plain text, they compress very well.
b) redirect logging to void. For example, on Linux, you can do it by creating a symlink to /dev/null instead of the regular log file:
# cd /opt/firebird
# rm -f firebird.log
# ln -s /dev/null firebird.log
Please note that you really shouldn't be doing this, as you will lose all valuable diagnostic information. It's better to try to find what are the errors, what's causing them and fix the problem at the source.
a) create a scheduled task or cron job that will truncate or rotate the log file. By rotation, we mean renaming the files in such way that you always have a number of previous logs available. Example:
delete firebird.log.5
rename firebird.log.4 firebird.log.5
rename firebird.log.3 firebird.log.4
rename firebird.log.2 firebird.log.3
rename firebird.log.1 firebird.log.2
rename firebird.log firebird.log.1
This way you'll always have last five logs available, and those too old get deleted. You can also use zip, rar, bzip2 or some other packer to compress the old log files. Since they are plain text, they compress very well.
b) redirect logging to void. For example, on Linux, you can do it by creating a symlink to /dev/null instead of the regular log file:
# cd /opt/firebird
# rm -f firebird.log
# ln -s /dev/null firebird.log
Please note that you really shouldn't be doing this, as you will lose all valuable diagnostic information. It's better to try to find what are the errors, what's causing them and fix the problem at the source.
Previous Question | Next Question |
How to disconnect the user connection? | How to pump the data from one database to another? |