Defined all structures for log processing
[public/netxms.git] / include / nxlog.h
CommitLineData
7259dd2c
VK
1/*
2** NetXMS - Network Management System
3** Copyright (C) 2003, 2004, 2005 Victor Kirhenshtein
4**
5** This program is free software; you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation; either version 2 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program; if not, write to the Free Software
17** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18**
19** $module: nxlog.h
20**
21**/
22
23#ifndef _nxlog_h_
24#define _nxlog_h_
25
26
27//
28// Constants
29//
30
31#define MAX_LOG_MSG_LENGTH 1024
32#define MAX_SYSLOG_HOSTNAME_LEN 128
33#define MAX_SYSLOG_TAG_LEN 33
34
35
36//
37// Syslog severity codes
38//
39
40#define SYSLOG_SEVERITY_EMERGENCY 0
41#define SYSLOG_SEVERITY_ALERT 1
42#define SYSLOG_SEVERITY_CRITICAL 2
43#define SYSLOG_SEVERITY_ERROR 3
44#define SYSLOG_SEVERITY_WARNING 4
45#define SYSLOG_SEVERITY_NOTICE 5
46#define SYSLOG_SEVERITY_INFORMATIONAL 6
47#define SYSLOG_SEVERITY_DEBUG 7
48
49
50//
30014381
VK
51// Policy flags
52//
53
54#define NX_LPPF_WINDOWS_EVENT_LOG 0x0001
55#define NX_LPPF_REPORT_UNMATCHED 0x0002
56
57
58//
7259dd2c
VK
59// Unified log record structure
60//
61
62typedef struct
63{
64 DWORD dwTimeStamp;
65 int nFacility;
66 int nSeverity;
67 DWORD dwSourceObject;
68 TCHAR szHostName[MAX_SYSLOG_HOSTNAME_LEN];
69 TCHAR szTag[MAX_SYSLOG_TAG_LEN];
70 TCHAR szMessage[MAX_LOG_MSG_LENGTH];
71} NX_LOG_RECORD;
72
73
30014381
VK
74//
75// Rule of log processing policy
76//
77
78typedef struct
79{
80 DWORD dwMsgIdFrom;
81 DWORD dwMsgIdTo;
82 int nFacility;
83 int nSeverity;
84 TCHAR szSource[MAX_DB_STRING];
85 TCHAR szRegExp[MAX_DB_STRING];
86 DWORD dwEvent;
87} NX_LPP_RULE;
88
89
90//
91// Log processing policy
92//
93
94typedef struct
95{
96 DWORD dwId;
97 TCHAR szName[MAX_OBJECT_NAME];
98 DWORD dwVersion;
99 DWORD dwFlags;
100 TCHAR szLogName[MAX_DB_STRING];
101 DWORD dwNumRules;
102 NX_LPP_RULE *pRuleList;
103} NX_LPP;
104
105
7259dd2c 106#endif