-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
FileConfig.java
93 lines (78 loc) · 2.39 KB
/
FileConfig.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package io.quarkus.runtime.logging;
import java.io.File;
import java.util.Optional;
import java.util.logging.Level;
import io.quarkus.runtime.annotations.ConfigGroup;
import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.configuration.MemorySize;
@ConfigGroup
public class FileConfig {
/**
* Default file name where logs should be stored.
*/
public static final String DEFAULT_LOG_FILE_NAME = "quarkus.log";
/**
* If file logging should be enabled
*/
@ConfigItem
boolean enable;
/**
* The log format
*/
@ConfigItem(defaultValue = "%d{yyyy-MM-dd HH:mm:ss,SSS} %h %N[%i] %-5p [%c{3.}] (%t) %s%e%n")
String format;
/**
* The level of logs to be written into the file.
*/
@ConfigItem(defaultValue = "ALL")
Level level;
/**
* The name of the file in which logs will be written.
*/
@ConfigItem(defaultValue = DEFAULT_LOG_FILE_NAME)
File path;
/**
* The name of the filter to link to the file handler.
*/
@ConfigItem
Optional<String> filter;
/**
* File async logging config
*/
AsyncConfig async;
/**
* File rotation config.
* The time interval is determined by the content of the <code>fileSuffix</code> property.
* The size interval is determined by the content of the <code>maxFileSize</code> property.
* If both are used, the rotating will be based on time then size.
*/
RotationConfig rotation;
@ConfigGroup
public static class RotationConfig {
/**
* The maximum file size of the log file after which a rotation is executed.
*/
@ConfigItem(defaultValue = "10M")
MemorySize maxFileSize;
/**
* The maximum number of backups to keep.
*/
@ConfigItem(defaultValue = "5")
int maxBackupIndex;
/**
* File handler rotation file suffix.
* When used, the file will be rotated based on its suffix.
*
* Example fileSuffix: .yyyy-MM-dd
*/
@ConfigItem
Optional<String> fileSuffix;
/**
* Indicates whether to rotate log files on server initialization.
* <p>
* You need to either set a {@code max-file-size} or configure a {@code file-suffix} for it to work.
*/
@ConfigItem(defaultValue = "true")
boolean rotateOnBoot;
}
}