62336d32d360b7f2bd82b6bef987646cfc616620
[public/netxms.git] / include / nxlog.h
1 /*
2 ** NetXMS - Network Management System
3 ** Copyright (C) 2003-2010 Victor Kirhenshtein
4 **
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU Lesser General Public License as published
7 ** by the Free Software Foundation; either version 3 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 Lesser 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 ** File: nxlog.h
20 **
21 **/
22
23 #ifndef _nxlog_h_
24 #define _nxlog_h_
25
26
27 //
28 // Constants
29 //
30
31 #define MAX_OBJECT_NAME 64
32 #define MAX_LOG_MSG_LENGTH 1024
33 #define MAX_SYSLOG_HOSTNAME_LEN 128
34 #define MAX_SYSLOG_TAG_LEN 33
35
36
37 //
38 // Syslog severity codes
39 //
40
41 #define SYSLOG_SEVERITY_EMERGENCY 0
42 #define SYSLOG_SEVERITY_ALERT 1
43 #define SYSLOG_SEVERITY_CRITICAL 2
44 #define SYSLOG_SEVERITY_ERROR 3
45 #define SYSLOG_SEVERITY_WARNING 4
46 #define SYSLOG_SEVERITY_NOTICE 5
47 #define SYSLOG_SEVERITY_INFORMATIONAL 6
48 #define SYSLOG_SEVERITY_DEBUG 7
49
50
51 //
52 // Policy flags
53 //
54
55 #define NX_LPPF_WINDOWS_EVENT_LOG 0x0001
56 #define NX_LPPF_REPORT_UNMATCHED 0x0002
57
58
59 //
60 // Syslog message structure
61 //
62
63 typedef struct
64 {
65 QWORD qwMsgId; // NetXMS internal message ID
66 time_t tmTimeStamp;
67 int nFacility;
68 int nSeverity;
69 UINT32 dwSourceObject;
70 char szHostName[MAX_SYSLOG_HOSTNAME_LEN];
71 char szTag[MAX_SYSLOG_TAG_LEN];
72 char szMessage[MAX_LOG_MSG_LENGTH];
73 } NX_SYSLOG_RECORD;
74
75
76 #endif