Added paramiko lodger creation
This commit is contained in:
parent
5f085c5eb1
commit
1b15bf25fb
1 changed files with 4 additions and 1 deletions
|
@ -31,7 +31,10 @@ class log_management:
|
||||||
self.logfile = "/etc/checkmyip/checkmyip.log"
|
self.logfile = "/etc/checkmyip/checkmyip.log"
|
||||||
self._publish_methods()
|
self._publish_methods()
|
||||||
self.can_log = True
|
self.can_log = True
|
||||||
|
try:
|
||||||
paramiko.util.log_to_file('/etc/checkmyip/ssh.log')
|
paramiko.util.log_to_file('/etc/checkmyip/ssh.log')
|
||||||
|
except IOError:
|
||||||
|
self._create_log_dir()
|
||||||
def _logger(self, data):
|
def _logger(self, data):
|
||||||
logdata = time.strftime("%Y-%m-%d %H:%M:%S") + ": " + data + "\n"
|
logdata = time.strftime("%Y-%m-%d %H:%M:%S") + ": " + data + "\n"
|
||||||
if self.can_log:
|
if self.can_log:
|
||||||
|
|
Loading…
Reference in a new issue