View Javadoc

1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2011, 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;
15  
16  public class CoreConstants {
17  
18    // Note that the line.separator property can be looked up even by
19    // applets.
20    public static final String LINE_SEPARATOR = System.getProperty("line.separator");
21    public static final int LINE_SEPARATOR_LEN = LINE_SEPARATOR.length();
22  
23  
24    public static final String CODES_URL = "http://logback.qos.ch/codes.html";
25  
26    /**
27     * The default context name.
28     */
29    public static final String DEFAULT_CONTEXT_NAME = "default";
30    /**
31     * Customized pattern conversion rules are stored under this key in the
32     * {@link Context} object store.
33     */
34    public static final String PATTERN_RULE_REGISTRY = "PATTERN_RULE_REGISTRY";
35  
36    public static final String ISO8601_STR = "ISO8601";
37    public static final String ISO8601_PATTERN = "yyyy-MM-dd HH:mm:ss,SSS";
38    public static final String DAILY_DATE_PATTERN = "yyyy-MM-dd";
39  
40    /**
41     * Time format used in Common Log Format
42     */
43    static public final String CLF_DATE_PATTERN = "dd/MM/yyyy:HH:mm:ss Z";
44  
45    /**
46     * The key used in locating the evaluator map in context's object map.
47     */
48    static public final String EVALUATOR_MAP = "EVALUATOR_MAP";
49  
50    /**
51     * By convention, we assume that the static method named "valueOf" taking
52     * a string argument can restore a given object from its string
53     * representation.
54     */
55    static public final String VALUE_OF = "valueOf";
56  
57    /**
58     * An empty string.
59     */
60    public final static String EMPTY_STRING = "";
61  
62    /**
63     * An empty string array.
64     */
65    public final static String[] EMPTY_STRING_ARRAY = new String[]{};
66  
67    /**
68     * An empty Class array.
69     */
70    public final static Class<?>[] EMPTY_CLASS_ARRAY = new Class[]{};
71    public final static String CAUSED_BY = "Caused by: ";
72    public final static String WRAPPED_BY = "Wrapped by: ";
73  
74    public final static char PERCENT_CHAR = '%';
75    public static final char LEFT_PARENTHESIS_CHAR = '(';
76    public static final char RIGHT_PARENTHESIS_CHAR = ')';
77  
78    public static final char ESCAPE_CHAR = '\\';
79    public static final char CURLY_LEFT = '{';
80    public static final char CURLY_RIGHT = '}';
81    public static final char COMMA_CHAR = ',';
82    public static final char DOUBLE_QUOTE_CHAR = '"';
83    public static final char SINGLE_QUOTE_CHAR = '\'';
84  
85    /**
86     * Number of rows before in an HTML table before,
87     * we close the table and create a new one
88     */
89    public static final int TABLE_ROW_LIMIT = 10000;
90  
91  
92    // reset the ObjectOutputStream every OOS_RESET_FREQUENCY calls
93    // this avoid serious memory leaks
94    public static final int OOS_RESET_FREQUENCY = 70;
95  
96    /**
97     * The reference bogo instructions per second on
98     * Ceki's machine (Orion)
99     */
100   public static long REFERENCE_BIPS = 9000;
101 
102 
103   // the max number of times an error should be reported
104   static public final int MAX_ERROR_COUNT = 4;
105 
106 
107   static public final char DOT = '.';
108   static public final char TAB = '\t';
109   static public final char DOLLAR = '$';
110 
111   static public final String SEE_FNP_NOT_SET = "See also http://logback.qos.ch/codes.html#tbr_fnp_not_set";
112 
113   static public final String CONFIGURATION_WATCH_LIST = "CONFIGURATION_WATCH_LIST";
114   static public final String CONFIGURATION_WATCH_LIST_RESET = "CONFIGURATION_WATCH_LIST_RESET";
115 
116   static public final String SAFE_JORAN_CONFIGURATION = "SAFE_JORAN_CONFIGURATION";
117   static public final String XML_PARSING = "XML_PARSING";
118 
119 
120 
121   /**
122    * The key under which the local host name is registered in the logger
123    * context.
124    */
125   public static final String HOSTNAME_KEY = "HOSTNAME";
126 
127   /**
128    * The key under which the current context name is registered in the logger
129    * context.
130    */
131   public static final String CONTEXT_NAME_KEY = "CONTEXT_NAME";
132 
133 
134   public static int BYTES_PER_INT = 4;
135   public static final int MILLIS_IN_ONE_SECOND = 1000;
136   public static final int MILLIS_IN_ONE_MINUTE = MILLIS_IN_ONE_SECOND*60;
137   public static final int MILLIS_IN_ONE_HOUR = MILLIS_IN_ONE_MINUTE*60;
138   public static final int MILLIS_IN_ONE_DAY = MILLIS_IN_ONE_HOUR*24;
139   public static final int MILLIS_IN_ONE_WEEK = MILLIS_IN_ONE_DAY*7;
140 
141   public static final String CONTEXT_SCOPE_VALUE = "context";
142 
143   final public static String RESET_MSG_PREFIX = "Will reset and reconfigure context ";
144 }