FileLoggingSession.LogFileGenerated Event

Definition

Raised when a log file is saved.

// Register
event_token LogFileGenerated(TypedEventHandler<IFileLoggingSession, LogFileGeneratedEventArgs const&> const& handler) const;

// Revoke with event_token
void LogFileGenerated(event_token const* cookie) const;

// Revoke with event_revoker
FileLoggingSession::LogFileGenerated_revoker LogFileGenerated(auto_revoke_t, TypedEventHandler<IFileLoggingSession, LogFileGeneratedEventArgs const&> const& handler) const;
public event TypedEventHandler<IFileLoggingSession,LogFileGeneratedEventArgs> LogFileGenerated;
function onLogFileGenerated(eventArgs) { /* Your code */ }
fileLoggingSession.addEventListener("logfilegenerated", onLogFileGenerated);
fileLoggingSession.removeEventListener("logfilegenerated", onLogFileGenerated);
- or -
fileLoggingSession.onlogfilegenerated = onLogFileGenerated;
Public Custom Event LogFileGenerated As TypedEventHandler(Of IFileLoggingSession, LogFileGeneratedEventArgs) Implements LogFileGenerated

Event Type

Implements

Remarks

If no handler is registered for this event, log files will accumulate in the ApplicationData folder.

This event is raised when the session rolls over from one log file to the next. If the file needs to be preserved, your handler must move the file to a new location before returning. The FileLoggingSession might delete or overwrite the file anytime after your handler has returned.

When you register a handler for this event, if log files had been saved while there was no handler registered for this event, your newly-added handler will immediately be invoked once for each of the previously-saved log files.

Your handler must do any processing necessary to preserve the file.

This event is not raised for the last log file because the last log file does not roll over. Use CloseAndSaveToFileAsync to access the last log file.

Applies to