-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Enhanced Configuration #19
Labels
Type: Feature Request
New feature or request
Comments
拟定配置文件结构 "log4sp"
{
/**
* 全局线程池相关配置
* 兼容性:先读取配置文件,不存在则读取 core.cfg,还不存在使用默认值
*/
"GlobalThreadPool"
{
"QueueSize" "8192" // unsigned int (1 - 1024 * 1024 * 10)
"ThreadCount" "1" // unsigned int (1 - 1000)
}
/**
* 初始化 logger 列表
* 兼容性:如果不存在全局 logger "log4sp" 的配置项,则使用默认值创建
*/
"InitializeLoggers"
{
// 待定:已存在时,是直接跳过还是修改属性?
// Name: string
"log4sp"
{
// string (忽略大小写) | unsigned int (0 - 6)
"LogLevel" "Info"
// string (忽略大小写) | unsigned int (0 - 6)
"FlushLevel" "Off"
// string
"Pattern" "[%Y-%m-%d %H:%M:%S.%e] [%n] [%l] [%s:%#] %v"
// unsigned long long (0 = 关闭 | 其他 = 启用)
"Backtrace" "0"
"Sinks"
{
// string (忽略大小写) | BaseFile | DailyFile | RotatingFile | ServerConsole
"type" "..."
// string (忽略大小写) | unsigned int (0 - 6)
"LogLevel" "Trace"
// string | logger Pattern 执行在后会覆盖
"Pattern" "[%Y-%m-%d %H:%M:%S.%e] [%n] [%l] [%s:%#] %v"
}
// bool | true = Handle 可释放 | false = Handle 不可释放
"Closeable" "false"
// "ErrorHandler" // 待定
}
"logger-2"
{ ... }
"logger-3"
{ ... }
[...]
}
} |
拟定实现方案
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
最初由 @blueblur0730 在 modified-plugins 中提出
现状:
目前唯一可配置的功能只有全局线程池,并且只能将配置项写在
core.cfg
里。期望:
从专用的
log4sp.cfg
中读取配置,并支持配置更多功能。(例如:创建 logger)The text was updated successfully, but these errors were encountered: