NCBI C++ ToolKit
Classes | Macros | Enumerations | Functions | Variables
ncbidiag.cpp File Reference
#include <ncbi_pch.hpp>
#include <common/ncbi_source_ver.h>
#include <common/ncbi_package_ver.h>
#include <common/ncbi_sanitizers.h>
#include <corelib/ncbiexpt.hpp>
#include <corelib/version.hpp>
#include <corelib/ncbi_process.hpp>
#include <corelib/ncbifile.hpp>
#include <corelib/syslog.hpp>
#include <corelib/error_codes.hpp>
#include <corelib/request_ctx.hpp>
#include <corelib/request_control.hpp>
#include <corelib/ncbi_strings.h>
#include <corelib/impl/ncbi_param_impl.hpp>
#include <corelib/ncbiapp_api.hpp>
#include "ncbidiag_p.hpp"
#include "ncbisys.hpp"
#include <fcntl.h>
#include <stdlib.h>
#include <stack>
#include <atomic>
#include <thread>
#include <unordered_set>
#include <sstream>
#include <unistd.h>
#include <sys/utsname.h>
#include <io.h>
+ Include dependency graph for ncbidiag.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CDiagLock
 
class  CDiagFileHandleHolder
 
class  CTeeDiagHandler
 
class  CLogRateLimit
 
class  CDiagContextThreadData
 Thread local context data stored in TLS. More...
 
class  CDiagRecycler
 
struct  SDiagMessageData
 
struct  SNcbiApplogKeywordsInit
 
class  CRecursionGuard
 
struct  SThreadsInSTBuild
 
class  CExtraDecoder
 
class  CExtraEncoder
 
struct  SAsyncDiagMessage
 
class  CAsyncDiagThread
 
struct  SMessageBuffer
 
class  CCompatDiagHandler
 
class  CCompatStreamDiagHandler
 

Macros

#define NCBI_USE_ERRCODE_X   Corelib_Diag
 
#define USE_TLS_DATA_CACHE
 

Enumerations

enum  EThreadDataState {
  eUninitialized = 0 , eInitializing , eInitialized , eDeinitialized ,
  eReinitializing
}
 
enum  EDiagMergeLines { eDiagMergeLines_Default , eDiagMergeLines_Off , eDiagMergeLines_On }
 

Functions

 DEFINE_STATIC_MUTEX (s_DiagMutex)
 
 DEFINE_STATIC_MUTEX (s_DiagPostMutex)
 
 DEFINE_STATIC_MUTEX (s_ApproveMutex)
 
void g_Diag_Use_RWLock (bool enable)
 Use RW-lock for synchronization rather than mutex. More...
 
 NCBI_PARAM_DECL (bool, Diag, Old_Post_Format)
 
 NCBI_PARAM_DEF_EX (bool, Diag, Old_Post_Format, true, eParam_NoThread, DIAG_OLD_POST_FORMAT)
 
 NCBI_PARAM_DECL (bool, Diag, AutoWrite_Context)
 
 NCBI_PARAM_DEF_EX (bool, Diag, AutoWrite_Context, false, eParam_NoThread, DIAG_AUTOWRITE_CONTEXT)
 
 NCBI_PARAM_DECL (bool, Diag, Print_System_TID)
 
 NCBI_PARAM_DEF_EX (bool, Diag, Print_System_TID, false, eParam_NoThread, DIAG_PRINT_SYSTEM_TID)
 
 NCBI_PARAM_DECL (bool, Diag, Assert_On_Abort)
 
 NCBI_PARAM_DEF_EX (bool, Diag, Assert_On_Abort, false, eParam_NoThread, DIAG_ASSERT_ON_ABORT)
 
 NCBI_PARAM_DECL (long, Diag, Log_Size_Limit)
 
 NCBI_PARAM_DEF_EX (long, Diag, Log_Size_Limit, 0, eParam_NoThread, DIAG_LOG_SIZE_LIMIT)
 
 NCBI_PARAM_DECL (size_t, Diag, Max_Line_Length)
 
 NCBI_PARAM_DEF_EX (size_t, Diag, Max_Line_Length, 0, eParam_NoThread, DIAG_MAX_LINE_LENGTH)
 
CNcbiIstreamoperator>> (CNcbiIstream &in, CLogRateLimit &lim)
 
 NCBI_PARAM_STATIC_PROXY (CLogRateLimit, CLogRateLimit::TValue)
 
 NCBI_PARAM_DECL (CLogRateLimit, Diag, AppLog_Rate_Limit)
 
 NCBI_PARAM_DEF_EX (CLogRateLimit, Diag, AppLog_Rate_Limit, 50000, eParam_NoThread, DIAG_APPLOG_RATE_LIMIT)
 
 NCBI_PARAM_DECL (unsigned int, Diag, AppLog_Rate_Period)
 
 NCBI_PARAM_DEF_EX (unsigned int, Diag, AppLog_Rate_Period, 10, eParam_NoThread, DIAG_APPLOG_RATE_PERIOD)
 
 NCBI_PARAM_DECL (CLogRateLimit, Diag, ErrLog_Rate_Limit)
 
 NCBI_PARAM_DEF_EX (CLogRateLimit, Diag, ErrLog_Rate_Limit, 5000, eParam_NoThread, DIAG_ERRLOG_RATE_LIMIT)
 
 NCBI_PARAM_DECL (unsigned int, Diag, ErrLog_Rate_Period)
 
 NCBI_PARAM_DEF_EX (unsigned int, Diag, ErrLog_Rate_Period, 1, eParam_NoThread, DIAG_ERRLOG_RATE_PERIOD)
 
 NCBI_PARAM_DECL (CLogRateLimit, Diag, TraceLog_Rate_Limit)
 
 NCBI_PARAM_DEF_EX (CLogRateLimit, Diag, TraceLog_Rate_Limit, 5000, eParam_NoThread, DIAG_TRACELOG_RATE_LIMIT)
 
 NCBI_PARAM_DECL (unsigned int, Diag, TraceLog_Rate_Period)
 
 NCBI_PARAM_DEF_EX (unsigned int, Diag, TraceLog_Rate_Period, 1, eParam_NoThread, DIAG_TRACELOG_RATE_PERIOD)
 
 NCBI_PARAM_DECL (bool, Diag, Tee_To_Stderr)
 
 NCBI_PARAM_DEF_EX (bool, Diag, Tee_To_Stderr, false, eParam_NoThread, DIAG_TEE_TO_STDERR)
 
typedef NCBI_PARAM_TYPE (Diag, Tee_To_Stderr) TTeeToStderr
 
 NCBI_PARAM_ENUM_DECL (EDiagSev, Diag, Tee_Min_Severity)
 
 NCBI_PARAM_ENUM_ARRAY (EDiagSev, Diag, Tee_Min_Severity)
 
 NCBI_PARAM_ENUM_DEF_EX (EDiagSev, Diag, Tee_Min_Severity, kTeeMinSeverityDef, eParam_NoThread, DIAG_TEE_MIN_SEVERITY)
 
 NCBI_PARAM_DECL (size_t, Diag, Collect_Limit)
 
 NCBI_PARAM_DEF_EX (size_t, Diag, Collect_Limit, 1000, eParam_NoThread, DIAG_COLLECT_LIMIT)
 
 NCBI_PARAM_DECL (bool, Log, Truncate)
 
 NCBI_PARAM_DEF_EX (bool, Log, Truncate, false, eParam_NoThread, LOG_TRUNCATE)
 
 NCBI_PARAM_DECL (bool, Log, NoCreate)
 
 NCBI_PARAM_DEF_EX (bool, Log, NoCreate, false, eParam_NoThread, LOG_NOCREATE)
 
 NCBI_PARAM_DECL (string, Log, LogEnvironment)
 
 NCBI_PARAM_DEF_EX (string, Log, LogEnvironment, "", eParam_NoThread, DIAG_LOG_ENVIRONMENT)
 
 NCBI_PARAM_DECL (string, Log, LogRegistry)
 
 NCBI_PARAM_DEF_EX (string, Log, LogRegistry, "", eParam_NoThread, DIAG_LOG_REGISTRY)
 
 NCBI_PARAM_DECL (bool, Diag, Disable_AppLog_Messages)
 
 NCBI_PARAM_DEF_EX (bool, Diag, Disable_AppLog_Messages, false, eParam_NoThread, DIAG_DISABLE_APPLOG_MESSAGES)
 
const char * str_rev_str (const char *begin_str, const char *end_str, const char *str_search)
 
const char * find_match (char lsep, char rsep, const char *start, const char *stop)
 
EDiagSev AdjustApplogPrintableSeverity (EDiagSev sev)
 
Uint8 s_GetThreadId (void)
 
static thread_local EThreadDataState s_ThreadDataState (eUninitialized)
 
Uint8 GetDiagRequestId (void)
 Get iteration number/request ID. More...
 
void SetDiagRequestId (Uint8 id)
 Set iteration number/request ID. More...
 
const char * s_AppStateToStr (EDiagAppState state)
 
EDiagAppState s_StrToAppState (const string &state)
 
 NCBI_PARAM_DECL (bool, Diag, UTC_Timestamp)
 
 NCBI_PARAM_DEF_EX (bool, Diag, UTC_Timestamp, false, eParam_NoThread, DIAG_UTC_TIMESTAMP)
 
static CTime s_GetFastTime (void)
 
CDiagContext::TUID s_CreateUID (CDiagContext::TUID base)
 
 DEFINE_STATIC_MUTEX (s_CreateGUIDMutex)
 
 DEFINE_STATIC_MUTEX (s_AppNameMutex)
 
bool IsGlobalProperty (const string &name)
 
 NCBI_PARAM_DECL (string, Log, Http_Session_Id)
 
 NCBI_PARAM_DEF_EX (string, Log, Http_Session_Id, "", eParam_NoThread, HTTP_NCBI_SID)
 
 NCBI_PARAM_DECL (string, Log, Session_Id)
 
 NCBI_PARAM_DEF_EX (string, Log, Session_Id, "", eParam_NoThread, NCBI_LOG_SESSION_ID)
 
 DEFINE_STATIC_MUTEX (s_DefaultSidMutex)
 
 NCBI_PARAM_DECL (string, Log, Client_Ip)
 
 NCBI_PARAM_DEF_EX (string, Log, Client_Ip, "", eParam_NoThread, NCBI_LOG_CLIENT_IP)
 
 NCBI_PARAM_DECL (string, Log, Http_Hit_Id)
 
 NCBI_PARAM_DEF_EX (string, Log, Http_Hit_Id, "", eParam_NoThread, HTTP_NCBI_PHID)
 
 NCBI_PARAM_DECL (string, Log, Hit_Id)
 
 NCBI_PARAM_DEF_EX (string, Log, Hit_Id, "", eParam_NoThread, NCBI_LOG_HIT_ID)
 
 DEFINE_STATIC_MUTEX (s_DefaultHidMutex)
 
string s_ReadString (const char *filename)
 
string GetDefaultLogLocation (CNcbiApplication &app)
 
typedef NCBI_PARAM_TYPE (Log, Truncate) TLogTruncateParam
 
bool OpenLogFileFromConfig (const string &logname)
 
static string s_GetLogConfigString (const CTempString name, const CTempString defval, CNcbiRegistry *config)
 
static bool s_GetLogConfigBool (const CTempString name, bool defval, CNcbiRegistry *config)
 
CDiagContextGetDiagContext (void)
 Get diag context instance. More...
 
 NCBI_PARAM_ENUM_DECL (EDiagSev, DEBUG, Stack_Trace_Level)
 
 NCBI_PARAM_ENUM_ARRAY (EDiagSev, DEBUG, Stack_Trace_Level)
 
 NCBI_PARAM_ENUM_DEF_EX (EDiagSev, DEBUG, Stack_Trace_Level, eDiag_Fatal, eParam_NoThread, DEBUG_STACK_TRACE_LEVEL)
 
void * InitDiagHandler (void)
 
static CDiagHandlers_CreateDefaultDiagHandler (void)
 
Uint8 s_ParseInt (const string &message, size_t &pos, size_t width, char sep)
 
CTempString s_ParseStr (const string &message, size_t &pos, char sep, bool optional=false)
 
bool x_IsEncodableChar (char c)
 
 NCBI_PARAM_ENUM_DECL (EDiagMergeLines, Diag, Merge_Lines)
 
 NCBI_PARAM_ENUM_ARRAY (EDiagMergeLines, Diag, Merge_Lines)
 
 NCBI_PARAM_ENUM_DEF_EX (EDiagMergeLines, Diag, Merge_Lines, eDiagMergeLines_Default, eParam_NoThread, DIAG_MERGE_LINES)
 
void s_FormatStackTrace (CNcbiOstream &os, const CStackTrace &trace)
 
static TDiagPostFlags s_SetDiagPostAllFlags (TDiagPostFlags &flags, TDiagPostFlags new_flags)
 
static void s_SetDiagPostFlag (TDiagPostFlags &flags, EDiagPostFlag flag)
 
static void s_UnsetDiagPostFlag (TDiagPostFlags &flags, EDiagPostFlag flag)
 
TDiagPostFlags SetDiagPostAllFlags (TDiagPostFlags flags)
 Set global post flags to "flags". More...
 
void SetDiagPostFlag (EDiagPostFlag flag)
 Set the specified flag (globally). More...
 
void UnsetDiagPostFlag (EDiagPostFlag flag)
 Unset the specified flag (globally). More...
 
TDiagPostFlags SetDiagTraceAllFlags (TDiagPostFlags flags)
 Versions of the above for extra trace flags. More...
 
void SetDiagTraceFlag (EDiagPostFlag flag)
 
void UnsetDiagTraceFlag (EDiagPostFlag flag)
 
void SetDiagPostPrefix (const char *prefix)
 Specify a string to prefix all subsequent error postings with. More...
 
void PushDiagPostPrefix (const char *prefix)
 Push a string to the list of message prefixes. More...
 
void PopDiagPostPrefix (void)
 Pop a string from the list of message prefixes. More...
 
EDiagSev SetDiagPostLevel (EDiagSev post_sev)
 Set the threshold severity for posting the messages. More...
 
EDiagSev GetDiagPostLevel (void)
 Get current threshold severity for posting the messages. More...
 
int CompareDiagPostLevel (EDiagSev sev1, EDiagSev sev2)
 Compare two severities. More...
 
bool IsVisibleDiagPostLevel (EDiagSev sev)
 Check if the specified severity is higher or equal to the currently selected post level and will be printed by ERR_POST. More...
 
void SetDiagFixedPostLevel (const EDiagSev post_sev)
 Sets and locks the level, combining the previous two calls. More...
 
bool DisableDiagPostLevelChange (bool disable_change)
 Disable change the diagnostic post level. More...
 
EDiagSev SetDiagDieLevel (EDiagSev die_sev)
 Set the "die" (abort) level for the program. More...
 
EDiagSev GetDiagDieLevel (void)
 Get the "die" (abort) level for the program. More...
 
bool IgnoreDiagDieLevel (bool ignore)
 Ignore the die level settings. More...
 
void SetDiagTrace (EDiagTrace how, EDiagTrace dflt)
 Set the diagnostic trace settings. More...
 
bool GetDiagTrace (void)
 Check if traces are enabled. More...
 
void SetDiagHandler (CDiagHandler *handler, bool can_delete)
 Set the diagnostic handler using the specified diagnostic handler class. More...
 
bool IsSetDiagHandler (void)
 Check if diagnostic handler is set. More...
 
CDiagHandlerGetDiagHandler (bool take_ownership, bool *current_ownership)
 Get the currently set diagnostic handler class. More...
 
void DiagHandler_Reopen (void)
 Ask diagnostic handler to reopen log files if necessary. More...
 
CDiagBuffer & GetDiagBuffer (void)
 
void SetSplitLogFile (bool value)
 Split log files flag. More...
 
bool GetSplitLogFile (void)
 Get split log files flag. More...
 
bool s_IsSpecialLogName (const string &name)
 
static bool s_CreateHandler (const string &fname, unique_ptr< CStreamDiagHandler_Base > &handler, EDiagFileType file_type)
 
 NCBI_PARAM_DECL (Uint4, Diag, Max_Async_Queue_Size)
 Maximum number of messages that allowed to be in the queue for asynchronous processing. More...
 
 NCBI_PARAM_DEF_EX (Uint4, Diag, Max_Async_Queue_Size, 10000, eParam_NoThread, DIAG_MAX_ASYNC_QUEUE_SIZE)
 
 NCBI_PARAM_DECL (size_t, Diag, Async_Buffer_Size)
 
 NCBI_PARAM_DEF_EX (size_t, Diag, Async_Buffer_Size, 32768, eParam_NoThread, DIAG_ASYNC_BUFFER_SIZE)
 
 NCBI_PARAM_DECL (size_t, Diag, Async_Buffer_Max_Lines)
 
 NCBI_PARAM_DEF_EX (size_t, Diag, Async_Buffer_Max_Lines, 100, eParam_NoThread, DIAG_ASYNC_BUFFER_MAX_LINES)
 
 NCBI_PARAM_DECL (int, Diag, Async_Batch_Size)
 Number of messages processed as a single batch by the asynchronous handler. More...
 
 NCBI_PARAM_DEF_EX (int, Diag, Async_Batch_Size, 10, eParam_NoThread, DIAG_ASYNC_BATCH_SIZE)
 
bool SetLogFile (const string &file_name, EDiagFileType file_type, bool quick_flush)
 Set log files. More...
 
string GetLogFile (EDiagFileType file_type)
 Get log file name for the given log type. More...
 
string GetLogFile (void)
 Get log file name or diag handler name. More...
 
bool IsDiagStream (const CNcbiOstream *os)
 
void SetDiagErrCodeInfo (CDiagErrCodeInfo *info, bool can_delete)
 Set handler for processing error codes. More...
 
bool IsSetDiagErrCodeInfo (void)
 Indicates whether an error-code processing handler has been set. More...
 
CDiagErrCodeInfoGetDiagErrCodeInfo (bool take_ownership)
 Get handler for processing error codes. More...
 
void SetDiagFilter (EDiagFilter what, const char *filter_str)
 Set diagnostic filter. More...
 
string GetDiagFilter (EDiagFilter what)
 Get current diagnostic filter. More...
 
void AppendDiagFilter (EDiagFilter what, const char *filter_str)
 Append diagnostic filter. More...
 
static string s_GetExceptionText (const CException *pex)
 
void SetDiagHandler (FDiagHandler func, void *data, FDiagCleanup cleanup)
 Set the diagnostic handler using the specified diagnostic handler and cleanup functions. More...
 
void SetDiagStream (CNcbiOstream *os, bool quick_flush, FDiagCleanup cleanup, void *cleanup_data, const string &stream_name)
 Set diagnostic stream. More...
 
CNcbiOstreamGetDiagStream (void)
 Get current diagnostic stream (if it was set by SetDiagStream) or NULL. More...
 
void SetDoubleDiagHandler (void)
 Output diagnostics using both old and new style handlers. More...
 
void SetAbortHandler (FAbortHandler func)
 Set/unset abort handler. More...
 
void Abort (void)
 Smart abort function. More...
 
bool s_ParseErrCodeInfoStr (string &str, const SIZE_TYPE line, int &x_code, int &x_severity, string &x_message, bool &x_ready)
 
const char * g_DiagUnknownFunction (void)
 
CDiagContext_Extra g_PostPerf (int status, double timespan, SDiagMessage::TExtraArgs &args)
 
void EndmFatal (const CNcbiDiag &diag)
 

Variables

static bool s_DiagUseRWLock = true
 
static CSafeStatic< CRWLocks_DiagRWLock (CSafeStaticLifeSpan(CSafeStaticLifeSpan::eLifeSpan_Long, 1))
 
static CSafeStatic< CAtomicCounter_WithAutoInits_ReopenEntered
 
static const char * kLogName_None = "NONE"
 
static const char * kLogName_Unknown = "UNKNOWN"
 
static const char * kLogName_Stdout = "STDOUT"
 
static const char * kLogName_Stderr = "STDERR"
 
static const char * kLogName_Stream = "STREAM"
 
static const char * kLogName_Memory = "MEMORY"
 
static const char * kLogName_Tee = "STDERR-TEE"
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, Old_Post_Format)> s_OldPostFormat (CSafeStaticLifeSpan(CSafeStaticLifeSpan::eLifeSpan_Long, 2))
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, AutoWrite_Context)> s_AutoWrite_Context
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, Print_System_TID)> s_PrintSystemTID
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, Log_Size_Limit)> s_LogSizeLimit
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, Max_Line_Length)> s_MaxLineLength
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, AppLog_Rate_Limit)> s_AppLogRateLimit
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, AppLog_Rate_Period)> s_AppLogRatePeriod
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, ErrLog_Rate_Limit)> s_ErrLogRateLimit
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, ErrLog_Rate_Period)> s_ErrLogRatePeriod
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, TraceLog_Rate_Limit)> s_TraceLogRateLimit
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, TraceLog_Rate_Period)> s_TraceLogRatePeriod
 
const EDiagSev kTeeMinSeverityDef
 
static CSafeStatic< NCBI_PARAM_TYPE(Diag, Disable_AppLog_Messages)> s_DisableAppLog
 
static bool s_FinishedSetupDiag = false
 
static CSafeStatic< CDiagFilters_TraceFilter
 
static CSafeStatic< CDiagFilters_PostFilter
 
static CSafeStatic< CDiagRecyclers_DiagRecycler
 
static thread_local CDiagContextThreadDatas_ThreadDataCache
 
static const Uint8 kOwnerTID_None = Uint8(-1)
 
static const char * s_AppStateStr []
 
static const char * s_LegacyAppStateStr []
 
const CDiagContext::TUID kUID_InitBase = 212
 
const CDiagContext::TUID kUID_Mult = 1265
 
const TDiagPostFlags kApplogDiagPostFlags
 
static const char * kNcbiApplogKeywordStrings []
 
static CSafeStatic< SNcbiApplogKeywordsInit::TKeywords, SNcbiApplogKeywordsInits_NcbiApplogKeywords
 
static const char * kExtraTypeArgName = "NCBIEXTRATYPE"
 
static CSafeStatic< NCBI_PARAM_TYPE(Log, Http_Session_Id)> s_HttpSessionId
 
static CSafeStatic< NCBI_PARAM_TYPE(Log, Session_Id)> s_DefaultSessionId
 
static CSafeStatic< NCBI_PARAM_TYPE(Log, Client_Ip)> s_DefaultClientIp
 
static CSafeStatic< NCBI_PARAM_TYPE(Log, Http_Hit_Id)> s_HttpHitId
 
static CSafeStatic< NCBI_PARAM_TYPE(Log, Hit_Id)> s_HitId
 
static CSafeStatic< unique_ptr< string > > s_HostRole
 
static CSafeStatic< unique_ptr< string > > s_HostLocation
 
static const char * kDiagTimeFormat = "Y-M-DTh:m:s.rZ"
 
static const int kDiagW_PID = 5
 
static const int kDiagW_TID = 3
 
static const int kDiagW_RID = 4
 
static const int kDiagW_AppState = 2
 
static const int kDiagW_SN = 4
 
static const int kDiagW_UID = 16
 
static const int kDiagW_Host = 15
 
static const int kDiagW_Client = 15
 
static const int kDiagW_Session = 24
 
static const char * kUnknown_Host = "UNK_HOST"
 
static const char * kUnknown_Client = "UNK_CLIENT"
 
static const char * kUnknown_Session = "UNK_SESSION"
 
static const char * kUnknown_App = "UNK_APP"
 
static const char * kRootLog = "/log/"
 
static const TDiagPostFlags s_DefaultPostFlags
 
static TDiagPostFlags s_PostFlags = 0
 
static bool s_DiagPostFlagsInitialized = false
 
void * s_DiagHandlerInitializer = InitDiagHandler()
 
CDiagHandlers_DefaultHandler = s_CreateDefaultDiagHandler()
 
static const char s_ExtraEncodeChars [256][4]
 
const int kLogReopenDelay = 60
 
static bool s_SplitLogFile = false
 
static FAbortHandler s_UserAbortHandler = 0
 

Macro Definition Documentation

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Corelib_Diag

Definition at line 74 of file ncbidiag.cpp.

◆ USE_TLS_DATA_CACHE

#define USE_TLS_DATA_CACHE

Definition at line 906 of file ncbidiag.cpp.

Enumeration Type Documentation

◆ EDiagMergeLines

Enumerator
eDiagMergeLines_Default 
eDiagMergeLines_Off 
eDiagMergeLines_On 

Definition at line 5540 of file ncbidiag.cpp.

◆ EThreadDataState

Enumerator
eUninitialized 
eInitializing 
eInitialized 
eDeinitialized 
eReinitializing 

Definition at line 897 of file ncbidiag.cpp.

Function Documentation

◆ AdjustApplogPrintableSeverity()

EDiagSev AdjustApplogPrintableSeverity ( EDiagSev  sev)

◆ DEFINE_STATIC_MUTEX() [1/7]

DEFINE_STATIC_MUTEX ( s_AppNameMutex  )

◆ DEFINE_STATIC_MUTEX() [2/7]

DEFINE_STATIC_MUTEX ( s_ApproveMutex  )

◆ DEFINE_STATIC_MUTEX() [3/7]

DEFINE_STATIC_MUTEX ( s_CreateGUIDMutex  )

◆ DEFINE_STATIC_MUTEX() [4/7]

DEFINE_STATIC_MUTEX ( s_DefaultHidMutex  )

◆ DEFINE_STATIC_MUTEX() [5/7]

DEFINE_STATIC_MUTEX ( s_DefaultSidMutex  )

◆ DEFINE_STATIC_MUTEX() [6/7]

DEFINE_STATIC_MUTEX ( s_DiagMutex  )

◆ DEFINE_STATIC_MUTEX() [7/7]

DEFINE_STATIC_MUTEX ( s_DiagPostMutex  )

◆ EndmFatal()

void EndmFatal ( const CNcbiDiag diag)

Definition at line 8360 of file ncbidiag.cpp.

References Abort().

◆ find_match()

const char* find_match ( char  lsep,
char  rsep,
const char *  start,
const char *  stop 
)

Definition at line 766 of file ncbidiag.cpp.

References NULL.

◆ g_PostPerf()

CDiagContext_Extra g_PostPerf ( int  status,
double  timespan,
SDiagMessage::TExtraArgs args 
)

◆ GetDefaultLogLocation()

string GetDefaultLogLocation ( CNcbiApplication app)

◆ GetDiagBuffer()

CDiagBuffer& GetDiagBuffer ( void  )

◆ InitDiagHandler()

void* InitDiagHandler ( void  )

◆ IsGlobalProperty()

bool IsGlobalProperty ( const string name)
inline

◆ NCBI_PARAM_DECL() [1/29]

NCBI_PARAM_DECL ( bool  ,
Diag  ,
Assert_On_Abort   
)

◆ NCBI_PARAM_DECL() [2/29]

NCBI_PARAM_DECL ( bool  ,
Diag  ,
AutoWrite_Context   
)

◆ NCBI_PARAM_DECL() [3/29]

NCBI_PARAM_DECL ( bool  ,
Diag  ,
Disable_AppLog_Messages   
)

◆ NCBI_PARAM_DECL() [4/29]

NCBI_PARAM_DECL ( bool  ,
Diag  ,
Old_Post_Format   
)

◆ NCBI_PARAM_DECL() [5/29]

NCBI_PARAM_DECL ( bool  ,
Diag  ,
Print_System_TID   
)

◆ NCBI_PARAM_DECL() [6/29]

NCBI_PARAM_DECL ( bool  ,
Diag  ,
Tee_To_Stderr   
)

◆ NCBI_PARAM_DECL() [7/29]

NCBI_PARAM_DECL ( bool  ,
Diag  ,
UTC_Timestamp   
)

◆ NCBI_PARAM_DECL() [8/29]

NCBI_PARAM_DECL ( bool  ,
Log  ,
NoCreate   
)

◆ NCBI_PARAM_DECL() [9/29]

NCBI_PARAM_DECL ( bool  ,
Log  ,
Truncate   
)

◆ NCBI_PARAM_DECL() [10/29]

NCBI_PARAM_DECL ( CLogRateLimit  ,
Diag  ,
AppLog_Rate_Limit   
)

◆ NCBI_PARAM_DECL() [11/29]

NCBI_PARAM_DECL ( CLogRateLimit  ,
Diag  ,
ErrLog_Rate_Limit   
)

◆ NCBI_PARAM_DECL() [12/29]

NCBI_PARAM_DECL ( CLogRateLimit  ,
Diag  ,
TraceLog_Rate_Limit   
)

◆ NCBI_PARAM_DECL() [13/29]

NCBI_PARAM_DECL ( int  ,
Diag  ,
Async_Batch_Size   
)

Number of messages processed as a single batch by the asynchronous handler.

◆ NCBI_PARAM_DECL() [14/29]

NCBI_PARAM_DECL ( long  ,
Diag  ,
Log_Size_Limit   
)

◆ NCBI_PARAM_DECL() [15/29]

NCBI_PARAM_DECL ( size_t  ,
Diag  ,
Async_Buffer_Max_Lines   
)

◆ NCBI_PARAM_DECL() [16/29]

NCBI_PARAM_DECL ( size_t  ,
Diag  ,
Async_Buffer_Size   
)

◆ NCBI_PARAM_DECL() [17/29]

NCBI_PARAM_DECL ( size_t  ,
Diag  ,
Collect_Limit   
)

◆ NCBI_PARAM_DECL() [18/29]

NCBI_PARAM_DECL ( size_t  ,
Diag  ,
Max_Line_Length   
)

◆ NCBI_PARAM_DECL() [19/29]

NCBI_PARAM_DECL ( string  ,
Log  ,
Client_Ip   
)

◆ NCBI_PARAM_DECL() [20/29]

NCBI_PARAM_DECL ( string  ,
Log  ,
Hit_Id   
)

◆ NCBI_PARAM_DECL() [21/29]

NCBI_PARAM_DECL ( string  ,
Log  ,
Http_Hit_Id   
)

◆ NCBI_PARAM_DECL() [22/29]

NCBI_PARAM_DECL ( string  ,
Log  ,
Http_Session_Id   
)

◆ NCBI_PARAM_DECL() [23/29]

NCBI_PARAM_DECL ( string  ,
Log  ,
LogEnvironment   
)

◆ NCBI_PARAM_DECL() [24/29]

NCBI_PARAM_DECL ( string  ,
Log  ,
LogRegistry   
)

◆ NCBI_PARAM_DECL() [25/29]

NCBI_PARAM_DECL ( string  ,
Log  ,
Session_Id   
)

◆ NCBI_PARAM_DECL() [26/29]

NCBI_PARAM_DECL ( Uint4  ,
Diag  ,
Max_Async_Queue_Size   
)

Maximum number of messages that allowed to be in the queue for asynchronous processing.

◆ NCBI_PARAM_DECL() [27/29]

NCBI_PARAM_DECL ( unsigned int  ,
Diag  ,
AppLog_Rate_Period   
)

◆ NCBI_PARAM_DECL() [28/29]

NCBI_PARAM_DECL ( unsigned int  ,
Diag  ,
ErrLog_Rate_Period   
)

◆ NCBI_PARAM_DECL() [29/29]

NCBI_PARAM_DECL ( unsigned int  ,
Diag  ,
TraceLog_Rate_Period   
)

◆ NCBI_PARAM_DEF_EX() [1/29]

NCBI_PARAM_DEF_EX ( bool  ,
Diag  ,
Assert_On_Abort  ,
false  ,
eParam_NoThread  ,
DIAG_ASSERT_ON_ABORT   
)

◆ NCBI_PARAM_DEF_EX() [2/29]

NCBI_PARAM_DEF_EX ( bool  ,
Diag  ,
AutoWrite_Context  ,
false  ,
eParam_NoThread  ,
DIAG_AUTOWRITE_CONTEXT   
)

◆ NCBI_PARAM_DEF_EX() [3/29]

NCBI_PARAM_DEF_EX ( bool  ,
Diag  ,
Disable_AppLog_Messages  ,
false  ,
eParam_NoThread  ,
DIAG_DISABLE_APPLOG_MESSAGES   
)

◆ NCBI_PARAM_DEF_EX() [4/29]

NCBI_PARAM_DEF_EX ( bool  ,
Diag  ,
Old_Post_Format  ,
true  ,
eParam_NoThread  ,
DIAG_OLD_POST_FORMAT   
)

◆ NCBI_PARAM_DEF_EX() [5/29]

NCBI_PARAM_DEF_EX ( bool  ,
Diag  ,
Print_System_TID  ,
false  ,
eParam_NoThread  ,
DIAG_PRINT_SYSTEM_TID   
)

◆ NCBI_PARAM_DEF_EX() [6/29]

NCBI_PARAM_DEF_EX ( bool  ,
Diag  ,
Tee_To_Stderr  ,
false  ,
eParam_NoThread  ,
DIAG_TEE_TO_STDERR   
)

◆ NCBI_PARAM_DEF_EX() [7/29]

NCBI_PARAM_DEF_EX ( bool  ,
Diag  ,
UTC_Timestamp  ,
false  ,
eParam_NoThread  ,
DIAG_UTC_TIMESTAMP   
)

◆ NCBI_PARAM_DEF_EX() [8/29]

NCBI_PARAM_DEF_EX ( bool  ,
Log  ,
NoCreate  ,
false  ,
eParam_NoThread  ,
LOG_NOCREATE   
)

◆ NCBI_PARAM_DEF_EX() [9/29]

NCBI_PARAM_DEF_EX ( bool  ,
Log  ,
Truncate  ,
false  ,
eParam_NoThread  ,
LOG_TRUNCATE   
)

◆ NCBI_PARAM_DEF_EX() [10/29]

NCBI_PARAM_DEF_EX ( CLogRateLimit  ,
Diag  ,
AppLog_Rate_Limit  ,
50000  ,
eParam_NoThread  ,
DIAG_APPLOG_RATE_LIMIT   
)

◆ NCBI_PARAM_DEF_EX() [11/29]

NCBI_PARAM_DEF_EX ( CLogRateLimit  ,
Diag  ,
ErrLog_Rate_Limit  ,
5000  ,
eParam_NoThread  ,
DIAG_ERRLOG_RATE_LIMIT   
)

◆ NCBI_PARAM_DEF_EX() [12/29]

NCBI_PARAM_DEF_EX ( CLogRateLimit  ,
Diag  ,
TraceLog_Rate_Limit  ,
5000  ,
eParam_NoThread  ,
DIAG_TRACELOG_RATE_LIMIT   
)

◆ NCBI_PARAM_DEF_EX() [13/29]

NCBI_PARAM_DEF_EX ( int  ,
Diag  ,
Async_Batch_Size  ,
10  ,
eParam_NoThread  ,
DIAG_ASYNC_BATCH_SIZE   
)

◆ NCBI_PARAM_DEF_EX() [14/29]

NCBI_PARAM_DEF_EX ( long  ,
Diag  ,
Log_Size_Limit  ,
,
eParam_NoThread  ,
DIAG_LOG_SIZE_LIMIT   
)

◆ NCBI_PARAM_DEF_EX() [15/29]

NCBI_PARAM_DEF_EX ( size_t  ,
Diag  ,
Async_Buffer_Max_Lines  ,
100  ,
eParam_NoThread  ,
DIAG_ASYNC_BUFFER_MAX_LINES   
)

◆ NCBI_PARAM_DEF_EX() [16/29]

NCBI_PARAM_DEF_EX ( size_t  ,
Diag  ,
Async_Buffer_Size  ,
32768  ,
eParam_NoThread  ,
DIAG_ASYNC_BUFFER_SIZE   
)

◆ NCBI_PARAM_DEF_EX() [17/29]

NCBI_PARAM_DEF_EX ( size_t  ,
Diag  ,
Collect_Limit  ,
1000  ,
eParam_NoThread  ,
DIAG_COLLECT_LIMIT   
)

◆ NCBI_PARAM_DEF_EX() [18/29]

NCBI_PARAM_DEF_EX ( size_t  ,
Diag  ,
Max_Line_Length  ,
,
eParam_NoThread  ,
DIAG_MAX_LINE_LENGTH   
)

◆ NCBI_PARAM_DEF_EX() [19/29]

NCBI_PARAM_DEF_EX ( string  ,
Log  ,
Client_Ip  ,
""  ,
eParam_NoThread  ,
NCBI_LOG_CLIENT_IP   
)

◆ NCBI_PARAM_DEF_EX() [20/29]

NCBI_PARAM_DEF_EX ( string  ,
Log  ,
Hit_Id  ,
""  ,
eParam_NoThread  ,
NCBI_LOG_HIT_ID   
)

◆ NCBI_PARAM_DEF_EX() [21/29]

NCBI_PARAM_DEF_EX ( string  ,
Log  ,
Http_Hit_Id  ,
""  ,
eParam_NoThread  ,
HTTP_NCBI_PHID   
)

◆ NCBI_PARAM_DEF_EX() [22/29]

NCBI_PARAM_DEF_EX ( string  ,
Log  ,
Http_Session_Id  ,
""  ,
eParam_NoThread  ,
HTTP_NCBI_SID   
)

◆ NCBI_PARAM_DEF_EX() [23/29]

NCBI_PARAM_DEF_EX ( string  ,
Log  ,
LogEnvironment  ,
""  ,
eParam_NoThread  ,
DIAG_LOG_ENVIRONMENT   
)

◆ NCBI_PARAM_DEF_EX() [24/29]

NCBI_PARAM_DEF_EX ( string  ,
Log  ,
LogRegistry  ,
""  ,
eParam_NoThread  ,
DIAG_LOG_REGISTRY   
)

◆ NCBI_PARAM_DEF_EX() [25/29]

NCBI_PARAM_DEF_EX ( string  ,
Log  ,
Session_Id  ,
""  ,
eParam_NoThread  ,
NCBI_LOG_SESSION_ID   
)

◆ NCBI_PARAM_DEF_EX() [26/29]

NCBI_PARAM_DEF_EX ( Uint4  ,
Diag  ,
Max_Async_Queue_Size  ,
10000  ,
eParam_NoThread  ,
DIAG_MAX_ASYNC_QUEUE_SIZE   
)

◆ NCBI_PARAM_DEF_EX() [27/29]

NCBI_PARAM_DEF_EX ( unsigned int  ,
Diag  ,
AppLog_Rate_Period  ,
10  ,
eParam_NoThread  ,
DIAG_APPLOG_RATE_PERIOD   
)

◆ NCBI_PARAM_DEF_EX() [28/29]

NCBI_PARAM_DEF_EX ( unsigned int  ,
Diag  ,
ErrLog_Rate_Period  ,
,
eParam_NoThread  ,
DIAG_ERRLOG_RATE_PERIOD   
)

◆ NCBI_PARAM_DEF_EX() [29/29]

NCBI_PARAM_DEF_EX ( unsigned int  ,
Diag  ,
TraceLog_Rate_Period  ,
,
eParam_NoThread  ,
DIAG_TRACELOG_RATE_PERIOD   
)

◆ NCBI_PARAM_ENUM_ARRAY() [1/3]

NCBI_PARAM_ENUM_ARRAY ( EDiagMergeLines  ,
Diag  ,
Merge_Lines   
)

Definition at line 5548 of file ncbidiag.cpp.

References eDiagMergeLines_Default, eDiagMergeLines_Off, and eDiagMergeLines_On.

◆ NCBI_PARAM_ENUM_ARRAY() [2/3]

NCBI_PARAM_ENUM_ARRAY ( EDiagSev  ,
DEBUG  ,
Stack_Trace_Level   
)

Definition at line 3983 of file ncbidiag.cpp.

References eDiag_Critical, eDiag_Error, eDiag_Fatal, eDiag_Info, eDiag_Trace, and eDiag_Warning.

◆ NCBI_PARAM_ENUM_ARRAY() [3/3]

NCBI_PARAM_ENUM_ARRAY ( EDiagSev  ,
Diag  ,
Tee_Min_Severity   
)

Definition at line 381 of file ncbidiag.cpp.

References eDiag_Critical, eDiag_Error, eDiag_Fatal, eDiag_Info, eDiag_Trace, and eDiag_Warning.

◆ NCBI_PARAM_ENUM_DECL() [1/3]

NCBI_PARAM_ENUM_DECL ( EDiagMergeLines  ,
Diag  ,
Merge_Lines   
)

◆ NCBI_PARAM_ENUM_DECL() [2/3]

NCBI_PARAM_ENUM_DECL ( EDiagSev  ,
DEBUG  ,
Stack_Trace_Level   
)

◆ NCBI_PARAM_ENUM_DECL() [3/3]

NCBI_PARAM_ENUM_DECL ( EDiagSev  ,
Diag  ,
Tee_Min_Severity   
)

◆ NCBI_PARAM_ENUM_DEF_EX() [1/3]

NCBI_PARAM_ENUM_DEF_EX ( EDiagMergeLines  ,
Diag  ,
Merge_Lines  ,
eDiagMergeLines_Default  ,
eParam_NoThread  ,
DIAG_MERGE_LINES   
)

◆ NCBI_PARAM_ENUM_DEF_EX() [2/3]

NCBI_PARAM_ENUM_DEF_EX ( EDiagSev  ,
DEBUG  ,
Stack_Trace_Level  ,
eDiag_Fatal  ,
eParam_NoThread  ,
DEBUG_STACK_TRACE_LEVEL   
)

◆ NCBI_PARAM_ENUM_DEF_EX() [3/3]

NCBI_PARAM_ENUM_DEF_EX ( EDiagSev  ,
Diag  ,
Tee_Min_Severity  ,
kTeeMinSeverityDef  ,
eParam_NoThread  ,
DIAG_TEE_MIN_SEVERITY   
)

◆ NCBI_PARAM_STATIC_PROXY()

NCBI_PARAM_STATIC_PROXY ( CLogRateLimit  ,
CLogRateLimit::TValue   
)

◆ NCBI_PARAM_TYPE() [1/2]

typedef NCBI_PARAM_TYPE ( Diag  ,
Tee_To_Stderr   
)

◆ NCBI_PARAM_TYPE() [2/2]

typedef NCBI_PARAM_TYPE ( Log  ,
Truncate   
)

◆ OpenLogFileFromConfig()

bool OpenLogFileFromConfig ( const string logname)

Definition at line 3481 of file ncbidiag.cpp.

References eDiagFile_All, NCBI_PARAM_TYPE(), and SetLogFile().

Referenced by CDiagContext::SetupDiag().

◆ operator>>()

CNcbiIstream& operator>> ( CNcbiIstream in,
CLogRateLimit lim 
)

Definition at line 320 of file ncbidiag.cpp.

References NStr::EqualNocase(), in(), kMax_UInt, and CLogRateLimit::Set().

◆ s_AppStateToStr()

const char* s_AppStateToStr ( EDiagAppState  state)

Definition at line 1220 of file ncbidiag.cpp.

References s_AppStateStr.

Referenced by CDiagContext::GetProperty(), and CDiagContext::WriteStdPrefix().

◆ s_CreateDefaultDiagHandler()

static CDiagHandler * s_CreateDefaultDiagHandler ( void  )
static

Definition at line 4041 of file ncbidiag.cpp.

References CDiagLock::eWrite, kLogName_Stderr, NcbiCerr, and s_DefaultHandler.

◆ s_CreateHandler()

static bool s_CreateHandler ( const string fname,
unique_ptr< CStreamDiagHandler_Base > &  handler,
EDiagFileType  file_type 
)
static

Definition at line 6862 of file ncbidiag.cpp.

References ERR_POST_X, file_type, Info(), kLogName_Stderr, and NcbiCerr.

Referenced by CFileDiagHandler::SetLogFile().

◆ s_CreateUID()

CDiagContext::TUID s_CreateUID ( CDiagContext::TUID  base)

Definition at line 1593 of file ncbidiag.cpp.

References CDiagContext::GetPID(), and t.

Referenced by CDiagContext::x_CreateUID(), and CDiagContext::x_CreateUID_AsyncSafe().

◆ s_FormatStackTrace()

void s_FormatStackTrace ( CNcbiOstream os,
const CStackTrace trace 
)

◆ s_GetExceptionText()

static string s_GetExceptionText ( const CException pex)
static

Definition at line 7803 of file ncbidiag.cpp.

References CException::GetMsg(), CException::ReportExtra(), and text().

Referenced by CNcbiDiag::x_Put().

◆ s_GetFastTime()

static CTime s_GetFastTime ( void  )
static

◆ s_GetLogConfigBool()

static bool s_GetLogConfigBool ( const CTempString  name,
bool  defval,
CNcbiRegistry config 
)
static

Definition at line 3524 of file ncbidiag.cpp.

References _T_STDSTRING, _T_XCSTRING, NcbiSys_getenv, NStr::StringToBool(), and val.

Referenced by CDiagContext::SetupDiag().

◆ s_GetLogConfigString()

static string s_GetLogConfigString ( const CTempString  name,
const CTempString  defval,
CNcbiRegistry config 
)
static

Definition at line 3509 of file ncbidiag.cpp.

References _T_STDSTRING, _T_XCSTRING, NcbiSys_getenv, and val.

Referenced by CDiagContext::SetupDiag().

◆ s_GetThreadId()

Uint8 s_GetThreadId ( void  )
inline

Definition at line 887 of file ncbidiag.cpp.

References GetCurrentThreadSystemID(), CThread::GetSelf(), and s_PrintSystemTID.

◆ s_IsSpecialLogName()

bool s_IsSpecialLogName ( const string name)

Definition at line 6717 of file ncbidiag.cpp.

Referenced by CFileDiagHandler::SetLogFile(), and SetLogFile().

◆ s_ParseErrCodeInfoStr()

bool s_ParseErrCodeInfoStr ( string str,
const SIZE_TYPE  line,
int x_code,
int x_severity,
string x_message,
bool x_ready 
)

◆ s_ParseInt()

Uint8 s_ParseInt ( const string message,
size_t &  pos,
size_t  width,
char  sep 
)

Definition at line 4680 of file ncbidiag.cpp.

References eUnknown, NCBI_THROW, NPOS, and NStr::StringToUInt8().

Referenced by SDiagMessage::ParseMessage().

◆ s_ParseStr()

CTempString s_ParseStr ( const string message,
size_t &  pos,
char  sep,
bool  optional = false 
)

Definition at line 4711 of file ncbidiag.cpp.

References eUnknown, kEmptyStr, NCBI_THROW, and NPOS.

Referenced by SDiagMessage::ParseMessage().

◆ s_ReadString()

string s_ReadString ( const char *  filename)
inline

Definition at line 3077 of file ncbidiag.cpp.

References in().

Referenced by CDiagContext::GetHostLocation(), and CDiagContext::GetHostRole().

◆ s_SetDiagPostAllFlags()

static TDiagPostFlags s_SetDiagPostAllFlags ( TDiagPostFlags flags,
TDiagPostFlags  new_flags 
)
static

Definition at line 6029 of file ncbidiag.cpp.

References eDPF_AtomicWrite, eDPF_Default, CDiagLock::eWrite, and flags.

Referenced by SetDiagPostAllFlags(), and SetDiagTraceAllFlags().

◆ s_SetDiagPostFlag()

static void s_SetDiagPostFlag ( TDiagPostFlags flags,
EDiagPostFlag  flag 
)
static

Definition at line 6045 of file ncbidiag.cpp.

References eDPF_Default, CDiagLock::eWrite, and flags.

Referenced by SetDiagPostFlag(), and SetDiagTraceFlag().

◆ s_StrToAppState()

EDiagAppState s_StrToAppState ( const string state)

◆ s_ThreadDataState()

static thread_local EThreadDataState s_ThreadDataState ( eUninitialized  )
static

◆ s_UnsetDiagPostFlag()

static void s_UnsetDiagPostFlag ( TDiagPostFlags flags,
EDiagPostFlag  flag 
)
static

Definition at line 6055 of file ncbidiag.cpp.

References eDPF_Default, CDiagLock::eWrite, and flags.

Referenced by UnsetDiagPostFlag(), and UnsetDiagTraceFlag().

◆ str_rev_str()

const char* str_rev_str ( const char *  begin_str,
const char *  end_str,
const char *  str_search 
)

Definition at line 615 of file ncbidiag.cpp.

References NULL.

◆ x_IsEncodableChar()

bool x_IsEncodableChar ( char  c)
inline

Definition at line 4782 of file ncbidiag.cpp.

References s_ExtraEncodeChars.

Referenced by CExtraDecoder::Decode().

Variable Documentation

◆ kApplogDiagPostFlags

const TDiagPostFlags kApplogDiagPostFlags
Initial value:
=
@ eDPF_OmitSeparator
No '—' separator before message.
Definition: ncbidiag.hpp:754
@ eDPF_OmitInfoSev
No sev. indication if eDiag_Info.
Definition: ncbidiag.hpp:753
@ eDPF_AppLog
Post message to application log.
Definition: ncbidiag.hpp:756

Definition at line 2220 of file ncbidiag.cpp.

Referenced by CDiagContext_Extra::Flush(), and CDiagContext::x_PrintMessage().

◆ kDiagTimeFormat

const char* kDiagTimeFormat = "Y-M-DTh:m:s.rZ"
static

Definition at line 3145 of file ncbidiag.cpp.

Referenced by SDiagMessage::ParseMessage(), and CDiagContext::WriteStdPrefix().

◆ kDiagW_AppState

const int kDiagW_AppState = 2
static

Definition at line 3150 of file ncbidiag.cpp.

Referenced by CDiagContext::WriteStdPrefix().

◆ kDiagW_Client

const int kDiagW_Client = 15
static

Definition at line 3154 of file ncbidiag.cpp.

Referenced by CDiagContext::WriteStdPrefix().

◆ kDiagW_Host

const int kDiagW_Host = 15
static

Definition at line 3153 of file ncbidiag.cpp.

Referenced by CDiagContext::WriteStdPrefix().

◆ kDiagW_PID

const int kDiagW_PID = 5
static

Definition at line 3147 of file ncbidiag.cpp.

Referenced by CDiagContext::WriteStdPrefix().

◆ kDiagW_RID

const int kDiagW_RID = 4
static

Definition at line 3149 of file ncbidiag.cpp.

Referenced by CDiagContext::WriteStdPrefix().

◆ kDiagW_Session

const int kDiagW_Session = 24
static

Definition at line 3155 of file ncbidiag.cpp.

Referenced by CDiagContext::WriteStdPrefix().

◆ kDiagW_SN

const int kDiagW_SN = 4
static

Definition at line 3151 of file ncbidiag.cpp.

Referenced by CDiagContext::WriteStdPrefix().

◆ kDiagW_TID

const int kDiagW_TID = 3
static

Definition at line 3148 of file ncbidiag.cpp.

Referenced by CDiagContext::WriteStdPrefix().

◆ kDiagW_UID

const int kDiagW_UID = 16
static

Definition at line 3152 of file ncbidiag.cpp.

Referenced by SDiagMessage::ParseMessage().

◆ kExtraTypeArgName

const char* kExtraTypeArgName = "NCBIEXTRATYPE"
static

Definition at line 2752 of file ncbidiag.cpp.

Referenced by CDiagContext_Extra::SetType(), and SDiagMessage::x_ParseExtraArgs().

◆ kLogName_Memory

const char* kLogName_Memory = "MEMORY"
static

Definition at line 180 of file ncbidiag.cpp.

Referenced by CDiagContext::SetupDiag().

◆ kLogName_None

const char* kLogName_None = "NONE"
static

Definition at line 175 of file ncbidiag.cpp.

Referenced by CFileDiagHandler::SetLogFile(), SetLogFile(), and CDiagContext::SetupDiag().

◆ kLogName_Stderr

const char* kLogName_Stderr = "STDERR"
static

◆ kLogName_Stdout

const char* kLogName_Stdout = "STDOUT"
static

Definition at line 177 of file ncbidiag.cpp.

Referenced by SetDiagStream(), and CDiagContext::SetupDiag().

◆ kLogName_Stream

const char* kLogName_Stream = "STREAM"
static

◆ kLogName_Tee

const char* kLogName_Tee = "STDERR-TEE"
static

Definition at line 181 of file ncbidiag.cpp.

Referenced by CTeeDiagHandler::GetLogName(), and CDiagContext::SetupDiag().

◆ kLogName_Unknown

const char* kLogName_Unknown = "UNKNOWN"
static

Definition at line 176 of file ncbidiag.cpp.

Referenced by CDiagHandler::GetLogName().

◆ kLogReopenDelay

const int kLogReopenDelay = 60

◆ kNcbiApplogKeywordStrings

const char* kNcbiApplogKeywordStrings[]
static

Definition at line 2459 of file ncbidiag.cpp.

Referenced by SNcbiApplogKeywordsInit::Create().

◆ kOwnerTID_None

const Uint8 kOwnerTID_None = Uint8(-1)
static

Definition at line 1041 of file ncbidiag.cpp.

Referenced by CDiagContextThreadData::SetRequestContext().

◆ kRootLog

const char* kRootLog = "/log/"
static

◆ kTeeMinSeverityDef

const EDiagSev kTeeMinSeverityDef
Initial value:
=
@ eDiag_Warning
Warning message.
Definition: ncbidiag.hpp:652

Definition at line 391 of file ncbidiag.cpp.

◆ kUID_InitBase

const CDiagContext::TUID kUID_InitBase = 212

◆ kUID_Mult

const CDiagContext::TUID kUID_Mult = 1265

◆ kUnknown_App

const char* kUnknown_App = "UNK_APP"
static

Definition at line 3160 of file ncbidiag.cpp.

Referenced by SDiagMessage::ParseMessage(), and CDiagContext::WriteStdPrefix().

◆ kUnknown_Client

const char* kUnknown_Client = "UNK_CLIENT"
static

Definition at line 3158 of file ncbidiag.cpp.

Referenced by SDiagMessage::ParseMessage(), and CDiagContext::WriteStdPrefix().

◆ kUnknown_Host

const char* kUnknown_Host = "UNK_HOST"
static

Definition at line 3157 of file ncbidiag.cpp.

Referenced by SDiagMessage::ParseMessage(), and CDiagContext::WriteStdPrefix().

◆ kUnknown_Session

const char* kUnknown_Session = "UNK_SESSION"
static

Definition at line 3159 of file ncbidiag.cpp.

Referenced by SDiagMessage::ParseMessage(), and CDiagContext::WriteStdPrefix().

◆ s_AppLogRateLimit

CSafeStatic<NCBI_PARAM_TYPE(Diag, AppLog_Rate_Limit)> s_AppLogRateLimit
static

Definition at line 341 of file ncbidiag.cpp.

Referenced by CDiagContext::GetLogRate_Limit(), and CDiagContext::SetLogRate_Limit().

◆ s_AppLogRatePeriod

CSafeStatic<NCBI_PARAM_TYPE(Diag, AppLog_Rate_Period)> s_AppLogRatePeriod
static

◆ s_AppStateStr

const char* s_AppStateStr[]
static
Initial value:
= {
"NS", "PB", "P", "PE", "RB", "R", "RE"
}

Definition at line 1212 of file ncbidiag.cpp.

Referenced by s_AppStateToStr(), and s_StrToAppState().

◆ s_AutoWrite_Context

CSafeStatic<NCBI_PARAM_TYPE(Diag, AutoWrite_Context)> s_AutoWrite_Context
static

Definition at line 267 of file ncbidiag.cpp.

Referenced by CDiagContext::SetAutoWrite(), and CDiagContext::SetProperty().

◆ s_DefaultClientIp

CSafeStatic<NCBI_PARAM_TYPE(Log, Client_Ip)> s_DefaultClientIp
static

◆ s_DefaultHandler

Definition at line 4034 of file ncbidiag.cpp.

Referenced by IsSetDiagHandler(), and s_CreateDefaultDiagHandler().

◆ s_DefaultPostFlags

const TDiagPostFlags s_DefaultPostFlags
static
Initial value:
=
@ eDPF_ErrCodeUseSeverity
Use severity from error code (default)
Definition: ncbidiag.hpp:703
@ eDPF_ErrCodeExplanation
Error explanation (default)
Definition: ncbidiag.hpp:702
@ eDPF_ErrorID
Error code and subcode (default)
Definition: ncbidiag.hpp:698
@ eDPF_Severity
Severity (default)
Definition: ncbidiag.hpp:697
@ eDPF_ErrCodeMessage
Error code message (default)
Definition: ncbidiag.hpp:701
@ eDPF_Prefix
Prefix (default)
Definition: ncbidiag.hpp:696

Definition at line 3945 of file ncbidiag.cpp.

◆ s_DefaultSessionId

CSafeStatic<NCBI_PARAM_TYPE(Log, Session_Id)> s_DefaultSessionId
static

Definition at line 2864 of file ncbidiag.cpp.

◆ s_DiagHandlerInitializer

void* s_DiagHandlerInitializer = InitDiagHandler()

Definition at line 4022 of file ncbidiag.cpp.

◆ s_DiagPostFlagsInitialized

bool s_DiagPostFlagsInitialized = false
static

Definition at line 3950 of file ncbidiag.cpp.

◆ s_DiagRecycler

CSafeStatic<CDiagRecycler> s_DiagRecycler
static

Definition at line 873 of file ncbidiag.cpp.

◆ s_DiagRWLock

◆ s_DiagUseRWLock

bool s_DiagUseRWLock = true
static

Definition at line 79 of file ncbidiag.cpp.

Referenced by CDiagLock::CDiagLock(), and g_Diag_Use_RWLock().

◆ s_DisableAppLog

CSafeStatic<NCBI_PARAM_TYPE(Diag, Disable_AppLog_Messages)> s_DisableAppLog
static

Definition at line 435 of file ncbidiag.cpp.

Referenced by CDiagContext_Extra::Flush(), and CDiagContext::x_PrintMessage().

◆ s_ErrLogRateLimit

CSafeStatic<NCBI_PARAM_TYPE(Diag, ErrLog_Rate_Limit)> s_ErrLogRateLimit
static

Definition at line 353 of file ncbidiag.cpp.

Referenced by CDiagContext::GetLogRate_Limit(), and CDiagContext::SetLogRate_Limit().

◆ s_ErrLogRatePeriod

CSafeStatic<NCBI_PARAM_TYPE(Diag, ErrLog_Rate_Period)> s_ErrLogRatePeriod
static

◆ s_ExtraEncodeChars

const char s_ExtraEncodeChars[256][4]
static

Definition at line 4745 of file ncbidiag.cpp.

Referenced by CExtraEncoder::Encode(), and x_IsEncodableChar().

◆ s_FinishedSetupDiag

bool s_FinishedSetupDiag = false
static

◆ s_HitId

CSafeStatic<NCBI_PARAM_TYPE(Log, Hit_Id)> s_HitId
static

Definition at line 2954 of file ncbidiag.cpp.

Referenced by CDiagContext::x_GetDefaultHitID().

◆ s_HostLocation

CSafeStatic< unique_ptr<string> > s_HostLocation
static

Definition at line 3089 of file ncbidiag.cpp.

Referenced by CDiagContext::GetHostLocation().

◆ s_HostRole

CSafeStatic< unique_ptr<string> > s_HostRole
static

Definition at line 3088 of file ncbidiag.cpp.

Referenced by CDiagContext::GetHostRole().

◆ s_HttpHitId

CSafeStatic<NCBI_PARAM_TYPE(Log, Http_Hit_Id)> s_HttpHitId
static

Definition at line 2948 of file ncbidiag.cpp.

Referenced by CDiagContext::x_GetDefaultHitID().

◆ s_HttpSessionId

CSafeStatic<NCBI_PARAM_TYPE(Log, Http_Session_Id)> s_HttpSessionId
static

Definition at line 2858 of file ncbidiag.cpp.

◆ s_LegacyAppStateStr

const char* s_LegacyAppStateStr[]
static
Initial value:
= {
"AB", "A", "AE"
}

Definition at line 1216 of file ncbidiag.cpp.

Referenced by s_StrToAppState().

◆ s_LogSizeLimit

CSafeStatic<NCBI_PARAM_TYPE(Diag, Log_Size_Limit)> s_LogSizeLimit
static

Definition at line 286 of file ncbidiag.cpp.

Referenced by CFileHandleDiagHandler::Reopen(), and CDiagContext::SetupDiag().

◆ s_MaxLineLength

CSafeStatic<NCBI_PARAM_TYPE(Diag, Max_Line_Length)> s_MaxLineLength
static

Definition at line 292 of file ncbidiag.cpp.

Referenced by SDiagMessage::x_NewWrite().

◆ s_NcbiApplogKeywords

Definition at line 2619 of file ncbidiag.cpp.

Referenced by CDiagContext_Extra::Print().

◆ s_OldPostFormat

◆ s_PostFilter

CSafeStatic<CDiagFilter> s_PostFilter
static

◆ s_PostFlags

TDiagPostFlags s_PostFlags = 0
static

Definition at line 3949 of file ncbidiag.cpp.

◆ s_PrintSystemTID

CSafeStatic<NCBI_PARAM_TYPE(Diag, Print_System_TID)> s_PrintSystemTID
static

◆ s_ReopenEntered

CSafeStatic<CAtomicCounter_WithAutoInit> s_ReopenEntered
static

◆ s_SplitLogFile

bool s_SplitLogFile = false
static

◆ s_ThreadDataCache

thread_local CDiagContextThreadData* s_ThreadDataCache
static

◆ s_TraceFilter

CSafeStatic<CDiagFilter> s_TraceFilter
static

◆ s_TraceLogRateLimit

CSafeStatic<NCBI_PARAM_TYPE(Diag, TraceLog_Rate_Limit)> s_TraceLogRateLimit
static

Definition at line 365 of file ncbidiag.cpp.

Referenced by CDiagContext::GetLogRate_Limit(), and CDiagContext::SetLogRate_Limit().

◆ s_TraceLogRatePeriod

CSafeStatic<NCBI_PARAM_TYPE(Diag, TraceLog_Rate_Period)> s_TraceLogRatePeriod
static

◆ s_UserAbortHandler

FAbortHandler s_UserAbortHandler = 0
static

Definition at line 8139 of file ncbidiag.cpp.

Referenced by Abort(), and SetAbortHandler().

Modified on Fri Mar 01 10:05:48 2024 by modify_doxy.py rev. 669887