@@ -39,9 +39,7 @@ public class TikaServerConfig {
3939
4040 public static final int DEFAULT_PORT = 9998 ;
4141 public static final String DEFAULT_HOST = "localhost" ;
42- public static final Set <String > LOG_LEVELS = new HashSet <>(Arrays .asList ("debug" , "info" ));
4342 private static final Logger LOG = LoggerFactory .getLogger (TikaServerConfig .class );
44- private static final int DEFAULT_DIGEST_MARK_LIMIT = 20 * 1024 * 1024 ;
4543 /**
4644 * Endpoints that expose the pipes/fetch machinery (process-isolated pipes
4745 * parsing and async batch processing). Selecting any of these requires
@@ -71,20 +69,15 @@ public class TikaServerConfig {
7169 private boolean allowPerRequestConfig = false ;
7270 private String cors = "" ;
7371 private boolean returnStackTrace = false ;
74- private String idBase = UUID
72+ private String id = UUID
7573 .randomUUID ()
7674 .toString ();
7775 private int port = DEFAULT_PORT ;
7876 private String host = DEFAULT_HOST ;
79- private int digestMarkLimit = DEFAULT_DIGEST_MARK_LIMIT ;
80- private String digest = "" ;
81- //debug or info only
82- private String logLevel = "" ;
77+ private String requestLogLevel = "" ;
8378 private Path configPath ;
8479 private ArrayList <String > endpoints = new ArrayList <>();
8580
86- private boolean preventStopMethod = false ;
87-
8881 private TlsConfig tlsConfig = new TlsConfig ();
8982
9083 /**
@@ -98,7 +91,6 @@ public static TikaServerConfig load(CommandLine commandLine) throws IOException,
9891
9992 TikaServerConfig config = null ;
10093 Set <String > settings = new HashSet <>();
101- Path pluginsConfig = null ;
10294
10395 if (commandLine .hasOption ("c" )) {
10496 config = load (Paths .get (commandLine .getOptionValue ("c" )), commandLine , settings );
@@ -144,10 +136,6 @@ public void setPort(int port) {
144136 this .port = port ;
145137 }
146138
147- public String getIdBase () {
148- return idBase ;
149- }
150-
151139 /**
152140 * Whether the pipes/fetch endpoints ({@code pipes}, {@code async}) may be
153141 * enabled. Off by default; selecting one of those endpoints without this set
@@ -210,15 +198,19 @@ public void setHost(String host) {
210198 this .host = host ;
211199 }
212200
213- public String getLogLevel () {
214- return logLevel ;
201+ /**
202+ * Severity at which each request URI is logged. Empty (the default) disables
203+ * request logging entirely; this does not change the log level of anything else.
204+ */
205+ public String getRequestLogLevel () {
206+ return requestLogLevel ;
215207 }
216208
217- public void setLogLevel (String level ) throws TikaConfigException {
209+ public void setRequestLogLevel (String level ) throws TikaConfigException {
218210 if (level .equals ("debug" ) || level .equals ("info" )) {
219- this .logLevel = level ;
211+ this .requestLogLevel = level ;
220212 } else {
221- throw new TikaConfigException ("log level must be one of: 'debug' or 'info'" );
213+ throw new TikaConfigException ("requestLogLevel must be one of: 'debug' or 'info'" );
222214 }
223215 }
224216
@@ -237,37 +229,17 @@ public boolean hasConfigFile() {
237229 return configPath != null ;
238230 }
239231
232+ @ com .fasterxml .jackson .annotation .JsonIgnore
240233 public Path getConfigPath () {
241234 return configPath ;
242235 }
243236
237+ /** Set from the -c argument at load time; not a user-settable config key. */
238+ @ com .fasterxml .jackson .annotation .JsonIgnore
244239 public void setConfigPath (String path ) {
245240 this .configPath = Paths .get (path );
246241 }
247242
248- public int getDigestMarkLimit () {
249- return digestMarkLimit ;
250- }
251-
252- public void setDigestMarkLimit (int digestMarkLimit ) {
253- this .digestMarkLimit = digestMarkLimit ;
254- }
255-
256- /**
257- * digest configuration string, e.g. md5 or sha256, alternately w 16 or 32 encoding,
258- * e.g. md5:32,sha256:16 would result in two digests per file
259- *
260- * @return
261- */
262- public String getDigest () {
263- return digest ;
264- }
265-
266- public void setDigest (String digest ) {
267- LOG .info ("As of Tika 2.5.0, you can set the digester via the AutoDetectParserConfig in " + "tika-config.xml. We plan to remove this commandline option in 2.8.0" );
268- this .digest = digest ;
269- }
270-
271243 public boolean isReturnStackTrace () {
272244 return returnStackTrace ;
273245 }
@@ -292,13 +264,15 @@ public void setEndpoints(ArrayList<String> endpoints) {
292264 this .endpoints = endpoints ;
293265 }
294266
267+ /**
268+ * Identifier for this server, surfaced in the startup log. Defaults to a random UUID.
269+ */
295270 public String getId () {
296- //TODO fix this
297- return idBase ;
271+ return id ;
298272 }
299273
300274 public void setId (String id ) {
301- this .idBase = id ;
275+ this .id = id ;
302276 }
303277
304278 private void addEndPoints (List <String > endPoints ) {
0 commit comments