View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.core.net;
15  
16  /**
17   * Constants used by syslog daemon and transitively by
18   * {@link SyslogAppenderBase}.
19   * 
20   * @author Ceki Gülcü
21   **/
22  public class SyslogConstants {
23  
24      static public final int SYSLOG_PORT = 514;
25  
26      // Following constants extracted from RFC 3164, we multiply them by 8
27      // in order to precompute the facility part of PRI.
28      // See RFC 3164, Section 4.1.1 for exact details.
29  
30      /** Emergency: system is unusable */
31      public static final int EMERGENCY_SEVERITY = 0;
32      /** Alert: action must be taken immediately */
33      public static final int ALERT_SEVERITY = 1;
34      /** Critical: critical conditions */
35      public static final int CRITICAL_SEVERITY = 2;
36      /** Error: error conditions */
37      public static final int ERROR_SEVERITY = 3;
38      /** Warning: warning conditions */
39      public static final int WARNING_SEVERITY = 4;
40      /** Notice: normal but significant condition */
41      public static final int NOTICE_SEVERITY = 5;
42      /** Informational: informational messages */
43      public static final int INFO_SEVERITY = 6;
44      /** Debug: debug-level messages */
45      public static final int DEBUG_SEVERITY = 7;
46  
47      /** kernel messages, numerical code 0. */
48      public static final int LOG_KERN = 0;
49      /** user-level messages, numerical code 1. */
50      public static final int LOG_USER = 1 << 3;
51      /** mail system, numerical code 2. */
52      public static final int LOG_MAIL = 2 << 3;
53      /** system daemons, numerical code 3. */
54      public static final int LOG_DAEMON = 3 << 3;
55      /** security/authorization messages, numerical code 4. */
56      public static final int LOG_AUTH = 4 << 3;
57      /** messages generated internally by syslogd, numerical code 5. */
58      public static final int LOG_SYSLOG = 5 << 3;
59      /** line printer subsystem, numerical code 6. */
60      public static final int LOG_LPR = 6 << 3;
61      /** network news subsystem, numerical code 7. */
62      public static final int LOG_NEWS = 7 << 3;
63      /** UUCP subsystem, numerical code 8 */
64      public static final int LOG_UUCP = 8 << 3;
65      /** clock daemon, numerical code 9. */
66      public static final int LOG_CRON = 9 << 3;
67      /** security/authorization messages, numerical code 10. */
68      public static final int LOG_AUTHPRIV = 10 << 3;
69      /** ftp daemon, numerical code 11. */
70      public static final int LOG_FTP = 11 << 3;
71      /** NTP subsystem, numerical code 12. */
72      public static final int LOG_NTP = 12 << 3;
73      /** log audit, numerical code 13. */
74      public static final int LOG_AUDIT = 13 << 3;
75      /** log alert, numerical code 14. */
76      public static final int LOG_ALERT = 14 << 3;
77      /** clock daemon, numerical code 15. */
78      public static final int LOG_CLOCK = 15 << 3;
79      /** reserved for local use, numerical code 16. */
80      public static final int LOG_LOCAL0 = 16 << 3;
81      /** reserved for local use, numerical code 17. */
82      public static final int LOG_LOCAL1 = 17 << 3;
83      /** reserved for local use, numerical code 18. */
84      public static final int LOG_LOCAL2 = 18 << 3;
85      /** reserved for local use, numerical code 19. */
86      public static final int LOG_LOCAL3 = 19 << 3;
87      /** reserved for local use, numerical code 20. */
88      public static final int LOG_LOCAL4 = 20 << 3;
89      /** reserved for local use, numerical code 21. */
90      public static final int LOG_LOCAL5 = 21 << 3;
91      /** reserved for local use, numerical code 22. */
92      public static final int LOG_LOCAL6 = 22 << 3;
93      /** reserved for local use, numerical code 23. */
94      public static final int LOG_LOCAL7 = 23 << 3;
95  }