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">
    
  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"/>
    
  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"/>
    
  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"/>
    
  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>
    
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.