Fortinet white logo
Fortinet white logo
2024.10.0

Logging

Logging

There are many different security platforms for which a FortiNDR Cloud Service connector could be useful. All those security software might have their own logging mechanism. For this reason, the Python Client Library provided by FortiNDR Cloud Services was decoupled from the logging mechanism. Therefore, the client library allows the option to provide a different logger’s instance when the client is created.

The provided logger must extend the FncClientLogger class that can be imported from fnc.logger and implement all its methods.

class FncClientLogger: 
     def set_level(self, level): 
       raise NotImplementedError()

     def critical(self, log: str): 
       raise NotImplementedError()

     def error(self, log: str): 
       raise NotImplementedError()

     def warning(self, log: str): 
       raise NotImplementedError()

     def info(self, log: str): 
       raise NotImplementedError()

     def debug(self, log: str): 
       raise NotImplementedError()

There are two additional methods that could be implemented to configure console or file logging if required.

def set_console_logging(self, enable: bool = False): 
       pass

     def set_log_to_file(self, enable: bool = False): 
       pass

Logging

Logging

There are many different security platforms for which a FortiNDR Cloud Service connector could be useful. All those security software might have their own logging mechanism. For this reason, the Python Client Library provided by FortiNDR Cloud Services was decoupled from the logging mechanism. Therefore, the client library allows the option to provide a different logger’s instance when the client is created.

The provided logger must extend the FncClientLogger class that can be imported from fnc.logger and implement all its methods.

class FncClientLogger: 
     def set_level(self, level): 
       raise NotImplementedError()

     def critical(self, log: str): 
       raise NotImplementedError()

     def error(self, log: str): 
       raise NotImplementedError()

     def warning(self, log: str): 
       raise NotImplementedError()

     def info(self, log: str): 
       raise NotImplementedError()

     def debug(self, log: str): 
       raise NotImplementedError()

There are two additional methods that could be implemented to configure console or file logging if required.

def set_console_logging(self, enable: bool = False): 
       pass

     def set_log_to_file(self, enable: bool = False): 
       pass