indexing description: "NT event log example" library: "elogger" copyright: "Copyright (c) 2006, AXA Rosenberg, and others (see copyright.txt)" author: "Ulrich Weiss, and others" license: "Eiffel Forum License v2 (see forum.txt)" date: "$Date: $" revision: "$Revision: $" archive: "$Archive: $" class ELOG_TEST_NT_EVENT_LOG inherit ELOG_SEVERITY_CONSTANTS export {NONE} all end creation make feature make is -- Configure loggers and write events do configure_logger write_log_events end h: ELOG_HIERARCHY -- Logging hierarchy configure_logger is local nt_appender: ELOG_NT_EVENT_LOG_APPENDER do -- create hierarchy with a default logging level of Debug create h.make (Warning_severity) -- attach an NT event log appender to the root logger create nt_appender.make ("EloggerExample", False) h.root.add_appender (nt_appender) end write_log_events is -- Write a series of events to the loggers do -- log events of different priority to logger "a" h.logger ("main").log_information (create {ELOG_SIMPLE_EVENT}.make ("This is an informational message")) h.logger ("main").log_harmless (create {ELOG_SIMPLE_EVENT}.make ("This is an harmless message")) h.logger ("main").log_warning (create {ELOG_SIMPLE_EVENT}.make ("This is a warning message")) h.logger ("main").log_critical (create {ELOG_SIMPLE_EVENT}.make ("This is an critical message")) h.logger ("main").log_fatal (create {ELOG_SIMPLE_EVENT}.make ("This is a fatal message")) -- close all appenders in the hierarchy h.close_all end end