elogger API
Overview Classes Cluster Class Index          Top Features

root_cluster.logging

Class ELOG_APPENDER


Direct ancestors

ELOG_FILTER_CONSTANTS, ELOG_SHARED_INTERNAL_LOGGER, MEMORY, THREAD_CONTROL, ELOG_SHARED_SYSTEM_CLOCK

Known direct descendants

ELOG_TRASH_APPENDER, ELOG_STDOUT_APPENDER, ELOG_FILE_APPENDER, ELOG_NT_EVENT_LOG_APPENDER, ELOG_SOCKET_APPENDER, ELOG_SPREAD_APPENDER, ELOG_BUFFER_APPENDER, ELOG_STDERR_APPENDER

Features

Invariants

indexing

description

Deferred appender class. This class defines the target of the logs.

deferred class ELOG_APPENDER

feature -- Removal

dispose

-- Close this appender when garbage collected. Perform
-- minimal operations to release resources. Do not call
-- other object as they may have been garbage collected.
-- (From DISPOSABLE)

deferred

feature -- Output

write_footer

-- write the layout footer to the appender
-- Note: This is done synchronously

require

footer_not_void: layout.footer /= Void

write_header

-- write the layout header to the appender
-- Note: this is done synchronously.

require

header_not_void: layout.header /= Void

feature {ELOG_LOGGER, ELOG_DISPATCHER, ELOG_APPENDER, TS_TEST_CASE} -- Output

append (event: ELOG_EVENT)

-- Log event on this appender (front end).

require

event_exists: event /= Void
is_open: is_open

feature -- Status Report

backup_appender: ELOG_APPENDER

-- if something goes wrong, use this appender.

backup_appender_timeout: INTEGER

-- timeout after which we retry this appender again after
-- a failure. this value starts from Start_backup_appender_timeout,
-- and doubles with each time the appender did not work.
-- e.g. 100ms, 200ms, 400ms, 800ms ... etc

backup_appender_timeout_max: INTEGER

-- The maximum time the timeout grows to. If this value is 0,
-- then the 'backup_appender_timeout' will grow unboundedly.
-- (until INTEGER_32.max is reached, which is 24 days)

backup_appender_timeout_min: INTEGER

-- The start of the timeout counter, e.g. 100 ms.
-- see 'backup_appender_timeout' for more information.

buffer_size: INTEGER

-- The maximum size of 'event_pool' in number
-- of elements. If this value is zero, there is
-- no limit to the buffer size (except the memory
-- available).

is_blocking: BOOLEAN

-- is the buffer blocking if it is full?
-- if it isn't, the events are summarized
-- and discarded.

is_open: BOOLEAN

-- Is the appender open for appending?

is_synchronous: BOOLEAN

-- Are the events beeing logged synchronously?

layout: ELOG_LAYOUT

-- Layout used to format events for this appender. May be Void
-- if no layout is used.

name: STRING

-- Name of this appender that uniquely
-- identifies it.

use_backup_appender: BOOLEAN

-- use backup_appender instead

feature -- Status Setting

close

-- Release of resources.

initialize_mutex

-- initialize the mutexes

set_asynchronous

-- sets 'is_synchronous' to False.

set_backup_appender (a_appender: ELOG_APPENDER; pass_settings: BOOLEAN)

-- sets 'backup_appender'
-- if pass_settings is true, all the settings
-- will be passed on.

ensure

no_cycle: not check_for_backup_cycle

set_backup_appender_timeout_max (a_backup_appender_timeout_max: INTEGER)

-- sets 'backup_appender_timeout_max' in milliseconds.

require

a_backup_appender_valid: a_backup_appender_timeout_max > backup_appender_timeout

set_backup_appender_timeout_min (a_backup_appender_timeout: INTEGER)

-- sets 'backup_appender_timeout' in milliseconds.

require

a_backup_appender_valid: a_backup_appender_timeout > 0 and a_backup_appender_timeout <= backup_appender_timeout_max

set_blocking (flag: BOOLEAN)

-- sets 'is_blocking'

set_buffer_size (size: INTEGER)

-- sets the maximal buffer size to 'size'.

set_filter (a_filter: ELOG_FILTER)

-- Set 'filter' to 'a_filter'. See ELOG_AND_FILTER or
-- ELOG_OR_FILTER on how to set multiple filters.
-- If a_filter is void, no filter will be used.

set_layout (new_layout: ELOG_LAYOUT)

-- Set the layout that this appender should use.

require

layout_exists: new_layout /= Void

set_name (new_name: STRING)

-- Set the name of this appender

require

name_exists: new_name /= Void

set_synchronous_force

-- sets 'is_synchronous' to True.
-- If the buffer still contains elements,
-- it will be emptied and the events discarded.

set_synchronous_wait

-- sets 'is_synchronous' to True.
-- If the buffer still contains elements, we wait
-- here until the pool is empty.

set_use_backup_appender (use_backup: BOOLEAN; current_event: ELOG_EVENT)

-- sets to use backup appender
-- this can be called from the dispatcher or the appender

wait (is_monitor_locked: BOOLEAN)

-- wait here until the consumer thread
-- has finished dispatching the events.

require

is_asynchronous: not is_synchronous

feature {ELOG_DISPATCHER} -- Implementation

append_monitor: ELOG_MUTEX

-- monitor used for synchronizing events

do_append (event: ELOG_EVENT)

-- Append 'event' to this appender.

require

event_exists: event /= Void
is_open: is_open

monitor: ELOG_MUTEX

-- monitor used for synchronizing events

invariant

layout_not_void: layout /= Void
buffer_size_non_negative: buffer_size >= 0
backup_appender_set: use_backup_appender implies backup_appender /= Void
event_pool_has_consumer_1: event_pool = Void implies consumer_thread = Void
event_pool_has_consumer_2: event_pool /= Void implies consumer_thread /= Void
event_pool_exists: (is_open and not is_synchronous) implies event_pool /= Void
backup_appender_timeout_valid: backup_appender_timeout > 0
backup_appender_timeout_max_valid: backup_appender_timeout_max >= backup_appender_timeout

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

Documentation generated by edoc