operating system services handler objects the logging module provides collection of pre-built handlers that can process log messages in various in ways these handlers are added to logger objects using their addhandler(method in additioneach handler can be configured with its own filtering and levels built-in handlers the following handler objects are built-in some of these handlers are defined in submodule logging handlerswhich must be imported specifically if necessary handlers datagramhandler(host,portsends log messages to udp server located on the given host and port log messages are encoded by taking the dictionary of the corresponding logrecord object and encoding it using the pickle module the transmitted network message consists of byte network order (big-endianlength followed by the pickled record data to reconstruct the messagethe receiver must strip the length headerread the entire messageunpickle the contentsand call logging makelogrecord(because udp is unreliablenetwork errors may result in lost log messages filehandler(filename [mode [encoding [delay]]]writes log messages to the file filename mode is the file mode to use when opening the file and defaults to 'aencoding is the file encoding delay is boolean flag thatif set truedefers the opening of the log file until the first log message is issued by defaultit is false handlers httphandler(hosturl [method]uploads log messages to an http server using http get or post methods host specifies the host machineurl is the url to useand method is either 'get(the defaultor 'postthe log message is encoded by taking the dictionary of the corresponding logrecord object and encoding it as set of url query-string variables using the urllib urlencode(function handlers memoryhandler(capacity [flushlevel [target]]this handler is used to collect log messages in memory and to flush them to another handlertargetperiodically capacity is the size of the memory buffer in bytes flushlevel is numeric logging level that forces memory flush should logging message of that level or higher appear the default value is error target is another handler object that receives the messages if target is omittedyou will need to set target using the settarget(method of the resulting handler object in order for this handler to do anything handlers nteventloghandler(appname [dllname [logtype]]sends messages to the event log on windows nt,windows or windows xp appname is the name of the application name to use in the event log dllname is full path name to dll or exe file that provides message definitions to hold in the log if omitteddllname is set to 'win service pydlogtype is either 'application''system'or 'securitythe default value is 'applicationthis handler is only available if win extensions for python have been installed lib fl ff