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;
15  
16  
17  public class CoreConstants {
18  
19      final public static String DISABLE_SERVLET_CONTAINER_INITIALIZER_KEY = "logbackDisableServletContainerInitializer";
20      final public static String STATUS_LISTENER_CLASS_KEY = "logback.statusListenerClass";
21      final public static String SYSOUT = "SYSOUT";
22  
23      /**
24       * Number of idle threads to retain in a context's executor service.
25       */
26      public static final int CORE_POOL_SIZE = 0;
27  
28      // Apparently ScheduledThreadPoolExecutor has limitation where a task cannot be submitted from 
29      // within a running task unless the pool has worker threads already available. ThreadPoolExecutor 
30      // does not have this limitation.
31      // This causes tests failures in SocketReceiverTest.testDispatchEventForEnabledLevel and
32      // ServerSocketReceiverFunctionalTest.testLogEventFromClient.
33      // We thus set a pool size > 0 for tests to pass.
34      public static final int SCHEDULED_EXECUTOR_POOL_SIZE = 1;
35  
36      
37      /**
38       * Maximum number of threads to allow in a context's executor service.
39       */
40      // if you need a different MAX_POOL_SIZE, please file create a jira issue
41      // asking to make MAX_POOL_SIZE a parameter.
42      public static final int MAX_POOL_SIZE = 32;
43  
44      // Note that the line.separator property can be looked up even by
45      // applets.
46      public static final String LINE_SEPARATOR = System.getProperty("line.separator");
47      public static final int LINE_SEPARATOR_LEN = LINE_SEPARATOR.length();
48  
49      public static final String CODES_URL = "http://logback.qos.ch/codes.html";
50      public static final String MANUAL_URL_PREFIX = "http://logback.qos.ch/manual/";   
51      public static final String MORE_INFO_PREFIX = "For more information, please visit ";
52  
53      /**
54       * The default context name.
55       */
56      public static final String DEFAULT_CONTEXT_NAME = "default";
57      /**
58       * Customized pattern conversion rules are stored under this key in the
59       * {@link Context} object store.
60       */
61      public static final String PATTERN_RULE_REGISTRY = "PATTERN_RULE_REGISTRY";
62  
63      public static final String ISO8601_STR = "ISO8601";
64      public static final String ISO8601_PATTERN = "yyyy-MM-dd HH:mm:ss,SSS";
65      public static final String DAILY_DATE_PATTERN = "yyyy-MM-dd";
66  
67      /**
68       * Time format used in Common Log Format
69       */
70      public static final String CLF_DATE_PATTERN = "dd/MMM/yyyy:HH:mm:ss Z";
71  
72      /**
73       * The key used in locating the evaluator map in context's object map.
74       */
75      public static final String EVALUATOR_MAP = "EVALUATOR_MAP";
76  
77      /**
78       * Key used to locate a map Files used by FileAppender instances in context's object map.
79       * 
80       * Said map consists of entries of the type (appender name, File option) 
81       */
82      public static final String FA_FILENAME_COLLISION_MAP = "FA_FILENAMES_MAP";
83  
84      /**
85       * Key used to locate a collision map for RollingFileAppender instances in context's object map.
86       * 
87       * The collision map consists of entities of the type (appender name, FileNamePattern option)
88       */
89      public static final String RFA_FILENAME_PATTERN_COLLISION_MAP = "RFA_FILENAME_PATTERN_COLLISION_MAP";
90  
91      /**
92       * By convention, we assume that the static method named "valueOf" taking
93       * a string argument can restore a given object from its string
94       * representation.
95       */
96      public static final String VALUE_OF = "valueOf";
97  
98      /**
99       * An empty string.
100      */
101     public static final String EMPTY_STRING = "";
102 
103     /**
104      * An empty string array.
105      */
106     public static final String[] EMPTY_STRING_ARRAY = new String[] {};
107 
108     /**
109      * An empty Class array.
110      */
111     public static final Class<?>[] EMPTY_CLASS_ARRAY = new Class[] {};
112     public static final String CAUSED_BY = "Caused by: ";
113     public static final String SUPPRESSED = "Suppressed: ";
114     public static final String WRAPPED_BY = "Wrapped by: ";
115 
116     public static final char PERCENT_CHAR = '%';
117     public static final char LEFT_PARENTHESIS_CHAR = '(';
118     public static final char RIGHT_PARENTHESIS_CHAR = ')';
119 
120     public static final char ESCAPE_CHAR = '\\';
121     public static final char CURLY_LEFT = '{';
122     public static final char CURLY_RIGHT = '}';
123     public static final char COMMA_CHAR = ',';
124     public static final char DOUBLE_QUOTE_CHAR = '"';
125     public static final char SINGLE_QUOTE_CHAR = '\'';
126     public static final char COLON_CHAR = ':';
127     public static final char DASH_CHAR = '-';
128     public static final String DEFAULT_VALUE_SEPARATOR = ":-";
129 
130     /**
131      * Number of rows before in an HTML table before,
132      * we close the table and create a new one
133      */
134     public static final int TABLE_ROW_LIMIT = 10000;
135 
136     // reset the ObjectOutputStream every OOS_RESET_FREQUENCY calls
137     // this avoid serious memory leaks
138     public static final int OOS_RESET_FREQUENCY = 70;
139 
140     /**
141      * The reference bogo instructions per second on
142      * Ceki's machine (Orion)
143      */
144     public static long REFERENCE_BIPS = 9000;
145 
146     // the max number of times an error should be reported
147     public static final int MAX_ERROR_COUNT = 4;
148 
149     public static final char DOT = '.';
150     public static final char TAB = '\t';
151     public static final char DOLLAR = '$';
152 
153     public static final String SEE_FNP_NOT_SET = "See also "+CODES_URL+"#tbr_fnp_not_set";
154     public static final String SEE_MISSING_INTEGER_TOKEN = "See also "+CODES_URL+"#sat_missing_integer_token";
155 
156     public static final String CONFIGURATION_WATCH_LIST = "CONFIGURATION_WATCH_LIST";
157     public static final String CONFIGURATION_WATCH_LIST_RESET_X = "CONFIGURATION_WATCH_LIST_RESET";
158 
159     public static final String SAFE_JORAN_CONFIGURATION = "SAFE_JORAN_CONFIGURATION";
160     public static final String XML_PARSING = "XML_PARSING";
161 
162     // Context Object name for the shutdown hook
163     public static final String SHUTDOWN_HOOK_THREAD = "SHUTDOWN_HOOK";
164 
165     /**
166      * The key under which the local host name is registered in the logger
167      * context.
168      */
169     public static final String HOSTNAME_KEY = "HOSTNAME";
170 
171     public static final String UNKNOWN_LOCALHOST = "UNKNOWN_LOCALHOST";
172 
173     /**
174      * The key under which the current context name is registered in the logger
175      * context.
176      */
177     public static final String CONTEXT_NAME_KEY = "CONTEXT_NAME";
178 
179     public static final int BYTES_PER_INT = 4;
180     public static final long MILLIS_IN_ONE_SECOND = 1000;
181     public static final long MILLIS_IN_ONE_MINUTE = MILLIS_IN_ONE_SECOND * 60;
182     public static final long MILLIS_IN_ONE_HOUR = MILLIS_IN_ONE_MINUTE * 60;
183     public static final long MILLIS_IN_ONE_DAY = MILLIS_IN_ONE_HOUR * 24;
184     public static final long MILLIS_IN_ONE_WEEK = MILLIS_IN_ONE_DAY * 7;
185 
186     /**
187      * The number of seconds to wait for compression jobs to finish.
188      */
189     public static final int SECONDS_TO_WAIT_FOR_COMPRESSION_JOBS = 30;
190 
191     public static final String CONTEXT_SCOPE_VALUE = "context";
192 
193     public static final String RESET_MSG_PREFIX = "Will reset and reconfigure context ";
194 
195     public static final String JNDI_COMP_PREFIX = "java:comp/env";
196 
197     public static final String UNDEFINED_PROPERTY_SUFFIX = "_IS_UNDEFINED";
198 
199     public static final String LEFT_ACCOLADE = new String(new char[] { CURLY_LEFT });
200     public static final String RIGHT_ACCOLADE = new String(new char[] { CURLY_RIGHT });
201     public static final long UNBOUNDED_TOTAL_SIZE_CAP = 0;
202     public static final int UNBOUND_HISTORY = 0;
203     
204     public static final String RECONFIGURE_ON_CHANGE_TASK = "RECONFIGURE_ON_CHANGE_TASK";
205     public static final String SIZE_AND_TIME_BASED_FNATP_IS_DEPRECATED = "SizeAndTimeBasedFNATP is deprecated. Use SizeAndTimeBasedRollingPolicy instead";
206 
207 }