better NAT logging
This commit is contained in:
parent
100942fb90
commit
3a4b8969c6
1 changed files with 4 additions and 1 deletions
5
nat.py
5
nat.py
|
@ -95,7 +95,10 @@ def main():
|
||||||
nat_log += aloes_nat.manage()
|
nat_log += aloes_nat.manage()
|
||||||
logging.info("Done.")
|
logging.info("Done.")
|
||||||
|
|
||||||
filename = "/var/log/nat-%s.log" % ctime
|
nat_directory = "/var/log/nat/"
|
||||||
|
if not os.path.exists(nat_directory):
|
||||||
|
os.makedirs(nat_directory)
|
||||||
|
filename = os.path.join(nat_directory, "nat_%s.log" % time.strftime('%Y_%m_%d_%Hh_%Mm'))
|
||||||
|
|
||||||
logging.info("Saving nat table into " + filename)
|
logging.info("Saving nat table into " + filename)
|
||||||
with open(filename, 'a') as f:
|
with open(filename, 'a') as f:
|
||||||
|
|
Loading…
Reference in a new issue