libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::NTUtils::EventLog Class Reference

#include <EventLog.hpp>

Inheritance diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::NTUtils::EventLog:
[legend]
Collaboration diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::NTUtils::EventLog:
[legend]

Public Types

enum  error_types {
  err_error =EVENTLOG_ERROR_TYPE , err_warning =EVENTLOG_WARNING_TYPE , err_information =EVENTLOG_INFORMATION_TYPE , err_audit_success =EVENTLOG_AUDIT_SUCCESS ,
  err_audit_fail =EVENTLOG_AUDIT_FAILURE
}
 
enum  categories {
  cat_none =CAT_NONE , cat_success =CAT_SUCCESS , cat_warning =CAT_WARNING , cat_error =CAT_ERROR ,
  cat_critical =CAT_CRITICAL , cat_information =CAT_INFO , cat_custom1 =CAT_CUSTOM1 , cat_custom2 =CAT_CUSTOM2 ,
  cat_custom3 =CAT_CUSTOM3 , cat_custom4 =CAT_CUSTOM4 , cat_custom5 =CAT_CUSTOM5
}
 
typedef win_exception exception_type
 

Public Member Functions

__stdcall EventLog ()
 
__stdcall EventLog (const tstring &event_src_name, const unsigned int types=err_error|err_warning|err_information, const tstring &server=_T(""), const tstring &appln_log=_T("Application"))
 
__stdcall ~EventLog ()
 
void __fastcall Create (const tstring &event_src_name, const unsigned int types=err_error|err_warning|err_information, const tstring &server=_T(""), const tstring &appln_log=_T("Application"))
 
void __fastcall Delete ()
 
void __fastcall Log (const error_types wType, const categories Category, const tstring &str, const unsigned long dwDataSize=0, void *const lpRawData=NULL, SID *const lpUserSid=NULL)
 
void __fastcall Log (const error_types wType, const categories Category, const tstringstream &strm, const unsigned long dwDataSize=0, void *const lpRawData=NULL, SID *const lpUserSid=NULL)
 
template<typename T >
void __fastcall Log (const error_types wType, const categories wCategory, const typename T::const_iterator &begin, const typename T::const_iterator &end, const unsigned long dwDataSize, void *const lpRawData, SID *const lpUserSid)
 

Additional Inherited Members

- Protected Member Functions inherited from jmmcg::LIBJMMCG_VER_NAMESPACE::non_copyable
 non_copyable ()=default
 
 ~non_copyable ()=default
 
 non_copyable (non_copyable const &)=delete
 
 non_copyable (non_copyable &&)=delete
 
void operator= (non_copyable const &)=delete
 
void operator= (non_copyable &&)=delete
 

Detailed Description

Definition at line 28 of file EventLog.hpp.

Member Typedef Documentation

◆ exception_type

Member Enumeration Documentation

◆ categories

Enumerator
cat_none 
cat_success 
cat_warning 
cat_error 
cat_critical 
cat_information 
cat_custom1 
cat_custom2 
cat_custom3 
cat_custom4 
cat_custom5 

Definition at line 41 of file EventLog.hpp.

◆ error_types

Enumerator
err_error 
err_warning 
err_information 
err_audit_success 
err_audit_fail 

Definition at line 34 of file EventLog.hpp.

Constructor & Destructor Documentation

◆ EventLog() [1/2]

__stdcall jmmcg::LIBJMMCG_VER_NAMESPACE::NTUtils::EventLog::EventLog ( )
inline

Definition at line 114 of file EventLog.hpp.

◆ EventLog() [2/2]

__stdcall jmmcg::LIBJMMCG_VER_NAMESPACE::NTUtils::EventLog::EventLog ( const tstring event_src_name,
const unsigned int  types = err_error|err_warning|err_information,
const tstring server = _T(""),
const tstring appln_log = _T("Application") 
)

Note that if the "EventLog" object accesses a remote server, it must run under an account that has the correct permissions to access the Event Log on the server, otherwise you'll get access violations & permission violations. The "system" account does not have network access so the local server should be used, i.e. pass "NULL", the default.

◆ ~EventLog()

__stdcall jmmcg::LIBJMMCG_VER_NAMESPACE::NTUtils::EventLog::~EventLog ( )
inline

Definition at line 119 of file EventLog.hpp.

Member Function Documentation

◆ Create()

void EventLog::Create ( const tstring event_src_name,
const unsigned int  types = err_error|err_warning|err_information,
const tstring server = _T(""),
const tstring appln_log = _T("Application") 
)
inline

Definition at line 61 of file EventLog.cpp.

◆ Delete()

void __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::NTUtils::EventLog::Delete ( )
inline

Definition at line 124 of file EventLog.hpp.

◆ Log() [1/3]

void __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::NTUtils::EventLog::Log ( const error_types  wType,
const categories  Category,
const tstring str,
const unsigned long  dwDataSize = 0,
void *const  lpRawData = NULL,
SID *const  lpUserSid = NULL 
)

Details of these types can be found by earching for help on the Win32 API function "::ReportEvent(...)".

◆ Log() [2/3]

void __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::NTUtils::EventLog::Log ( const error_types  wType,
const categories  Category,
const tstringstream strm,
const unsigned long  dwDataSize = 0,
void *const  lpRawData = NULL,
SID *const  lpUserSid = NULL 
)
inline

Definition at line 68 of file EventLog.hpp.

◆ Log() [3/3]

template<typename T >
void __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::NTUtils::EventLog::Log ( const error_types  wType,
const categories  wCategory,
const typename T::const_iterator &  begin,
const typename T::const_iterator &  end,
const unsigned long  dwDataSize,
void *const  lpRawData,
SID *const  lpUserSid 
)
inline

Definition at line 72 of file EventLog.hpp.


The documentation for this class was generated from the following files: