配置

.


插件缓存

.


启动参数

.


日志

UCS 提供了统一的日志方案. 对日志的配置可以在 ./deploy/bin/app/app.properties 文件中进行修改:

#
# Logging Configuration
#
logging.loggers.root.channel = splitter
# logging.loggers.root.level = information
# logging.loggers.root.level = notice
logging.loggers.root.level = debug

logging.channels.file.class = FileChannel
logging.channels.file.pattern = %Y-%m-%d %H:%M:%S.%i [%p] %s<%I> [%U %u] : %t
logging.channels.file.path = ${application.dir}log/${application.baseName}.log
logging.channels.file.rotation = daily
logging.channels.file.archive = number
logging.channels.file.purgeCount = 10

logging.channels.console.class = ColorConsoleChannel
logging.channels.console.pattern = %Y-%m-%d %H:%M:%S.%i [%p] %s<%I> [%U %u] : %t

logging.channels.webconsole.class = EventChannel

logging.channels.splitter.class = SplitterChannel
logging.channels.splitter.channels = console, webconsole, file


application.handleQtMessages = true

其中 logging.loggers.root.level 配置了日志的级别, 由高到底支持 **fatal , critical , error , warning , notice , information , debug , trace ** 几个级别.

其中 application.handleQtMessages 用于配置是否需要将 QT 的 qDebug 或 qInfo 等消息输出到日志中.

打印日志可使用:

logger().information("sendData: index: %u, length: %u", index, length);

的方式, 此种方式不带源代码文件和行号信息. 也可使用:

poco_information(_pContext->logger(), "sendData: index: %u, length: %u", index, length);

的方式, 此种方式会带源代码文件和行号信息. 具体细节可参考 ./deps/thirdparty/install/x86_64/include/Poco/Logger.hpoco logger 类API的定义.