Blame view

MLTD/src/ReportSyslog.py 538 Bytes
2e20dacc7   Thanasis Naskos   MLTD implementati...
1
2
3
4
5
6
7
8
9
10
11
12
  import logging.handlers
  
  def report(asset_id, risk, timeframe):
      my_logger = logging.getLogger('MyLogger')
      my_logger.setLevel(logging.DEBUG)
  
      # handler = logging.FileHandler('mltd.log')
      handler = logging.handlers.SysLogHandler(address='/dev/log')
      handler.ident = 'KEA-MLTD'
      formatter = logging.Formatter(' %(message)s')
      handler.setFormatter(formatter)
      my_logger.addHandler(handler)
4d1aeb784   Thanasis Naskos   Adding ip 10.0.2....
13
      my_logger.critical(f'source_ip: 10.0.2.15 target_ip: 10.0.2.15 asset: {asset_id} risk: {risk} timeframe: {timeframe}')
2e20dacc7   Thanasis Naskos   MLTD implementati...
14