此内容没有您所选择的语言版本。

5.5.7. Sample XML Configuration for a Async Log Handler


The following procedure demonstrates a sample configuration for an async log handler

Procedure 5.7. Configure the Async Log Handler

  1. Add the Async Log Handler Identifier Information

    The name property sets the unique identifier for this log handler.
    <async-handler name="Async_NFS_handlers">
    
    Copy to Clipboard Toggle word wrap
  2. Set the level Property

    The level property sets the maximum level of log message that the root logger records.
    <async-handler name="Async_NFS_handlers">
       <level name="INFO"/>
    
    Copy to Clipboard Toggle word wrap
  3. Define the queue-length

    The queue-length defines the maximum number of log messages that will be held by this handler while waiting for sub-handlers to respond.
    <async-handler name="Async_NFS_handlers">
       <level name="INFO"/>
       <queue-length value="512"/>
    
    Copy to Clipboard Toggle word wrap
  4. Set Overflow Response

    The overflow-action defines how this handler responds when its queue length is exceeded. This can be set to BLOCK or DISCARD. BLOCK makes the logging application wait until there is available space in the queue. This is the same behavior as an non-async log handler. DISCARD allows the logging application to continue but the log message is deleted.
    <async-handler name="Async_NFS_handlers">
       <level name="INFO"/>
       <queue-length value="512"/>
       <overflow-action value="block"/>
    
    Copy to Clipboard Toggle word wrap
  5. List subhandlers

    The subhandlers list is the list of log handlers to which this async handler passes its log messages.
    <async-handler name="Async_NFS_handlers">
       <level name="INFO"/>
       <queue-length value="512"/>
       <overflow-action value="block"/>
       <subhandlers>
          <handler name="FILE"/>
          <handler name="accounts-record"/>
       </subhandlers>
    </async-handler>
    
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat