New header file with structures and defines related to log processing
authorVictor Kirhenshtein <victor@netxms.org>
Sat, 24 Sep 2005 15:13:05 +0000 (15:13 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Sat, 24 Sep 2005 15:13:05 +0000 (15:13 +0000)
.gitattributes
include/nxlog.h [new file with mode: 0644]

index dffdda5..1174d2c 100644 (file)
@@ -140,6 +140,7 @@ include/nxclapi.h -text
 include/nxcscpapi.h -text
 include/nxevent.h -text
 include/nximage.h -text
+include/nxlog.h -text
 include/nxnt.h -text
 include/nxqueue.h -text
 include/nxsnmp.h -text
diff --git a/include/nxlog.h b/include/nxlog.h
new file mode 100644 (file)
index 0000000..6819297
--- /dev/null
@@ -0,0 +1,66 @@
+/* 
+** NetXMS - Network Management System
+** Copyright (C) 2003, 2004, 2005 Victor Kirhenshtein
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+** $module: nxlog.h
+**
+**/
+
+#ifndef _nxlog_h_
+#define _nxlog_h_
+
+
+//
+// Constants
+//
+
+#define MAX_LOG_MSG_LENGTH       1024
+#define MAX_SYSLOG_HOSTNAME_LEN  128
+#define MAX_SYSLOG_TAG_LEN       33
+
+
+//
+// Syslog severity codes
+//
+
+#define SYSLOG_SEVERITY_EMERGENCY      0
+#define SYSLOG_SEVERITY_ALERT          1
+#define SYSLOG_SEVERITY_CRITICAL       2
+#define SYSLOG_SEVERITY_ERROR          3
+#define SYSLOG_SEVERITY_WARNING        4
+#define SYSLOG_SEVERITY_NOTICE         5
+#define SYSLOG_SEVERITY_INFORMATIONAL  6
+#define SYSLOG_SEVERITY_DEBUG          7
+
+
+//
+// Unified log record structure
+//
+
+typedef struct
+{
+   DWORD dwTimeStamp;
+   int nFacility;
+   int nSeverity;
+   DWORD dwSourceObject;
+   TCHAR szHostName[MAX_SYSLOG_HOSTNAME_LEN];
+   TCHAR szTag[MAX_SYSLOG_TAG_LEN];
+   TCHAR szMessage[MAX_LOG_MSG_LENGTH];
+} NX_LOG_RECORD;
+
+
+#endif