public class Log
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
ALLOWED_FILE_NAME_PATTERN
Only allow logs with the file extension `.log` or `.txt` (can be suffixed by both `.0` and `.gz` in that order)
|
protected java.lang.String |
content
log content
|
static java.util.regex.Pattern[] |
IPV4_FILTER
whitelist patterns for IPv4 addresses
|
static java.util.regex.Pattern |
IPV4_PATTERN
pattern for IPv4 addresses
|
static java.util.regex.Pattern[] |
IPV6_FILTER
whitelist patterns for IPv4 addresses
|
static java.util.regex.Pattern |
IPV6_PATTERN
pattern for IPv6 addresses
|
static int |
MAX_LOG_LENGTH
Maximum length of log files that can be uploaded in bytes
|
| Constructor and Description |
|---|
Log(java.nio.file.Path logFile)
Create a new Log
|
Log(java.lang.String content)
Create a new Log
|
Log(java.lang.String dir,
java.lang.String file)
Deprecated.
Use
Log(Path) instead |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getContent() |
protected java.lang.String content
public static final java.util.regex.Pattern IPV4_PATTERN
public static final java.util.regex.Pattern[] IPV4_FILTER
public static final java.util.regex.Pattern IPV6_PATTERN
public static final java.util.regex.Pattern[] IPV6_FILTER
public static final java.util.regex.Pattern ALLOWED_FILE_NAME_PATTERN
public static final int MAX_LOG_LENGTH
public Log(java.nio.file.Path logFile)
throws java.io.IOException
logFile - The log file, which must have a file extension of '.log' or '.txt'. The file extension may be suffixed by both `.0` and `.gz`java.io.IOException - If an exception occurs while reading the logFilepublic Log(java.lang.String content)
content - The whole content of the log to share.@Deprecated
public Log(java.lang.String dir,
java.lang.String file)
throws java.io.IOException
Log(Path) insteaddir - The parent directory of the log filefile - The log file, which must have a file extension of '.log' or '.txt'. The file extension may be suffixed by both `.0` and `.gz`java.io.IOException - If an exception occurs while reading the logFile