All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.log.tld Maven / Gradle / Ivy





  Log4j 2 website.

This tag library is based on the Jakarta Commons Log Taglib by Joseph Ottinger and James
Strachan. For the most part, logging tags written against Jakarta Commons Log Taglib should
work against this library as well. However, the "category" attribute from Jakarta has become
the "logger" attribute in this library.

In accordance with the org.apache.logging.log4j.Logger API, this tag library has tags to
support the following logging calls: "catching", "entry", "exit", "log", "trace", "debug",
"info", "warn", "error", and "fatal". The "trace" tag was not supported in Jakarta Commons Log
Taglib. The "setLogger", "catching", "entry", and "trace" tags are new to this library. This
tag library also supports the conditional tag "ifEnabled" (new) and troubleshooting tag "dump"
(existed in Jakarta Commons Log Taglib).

By default, this tag library uses a different Logger for each JSP named after the JSP ID.
You can customize the Logger in any of the logging tags or the "ifEnabled" tag with the
"logger" attribute. You can also use the "setLogger" tag to specify the Logger that should apply
for the rest of a JSP's execution. If the "setLogger" tag comes before any other logging tags in
a JSP, the default Logger for that JSP will not be created, but instead the specified logger is
the only one that will be used.

Every effort was made to optimize these tags and ensure decent performance, but users of
this library should keep in mind that the creation and execution of JSP tags adds significant
overhead to the standard Log4j method calls. While the "trace", "debug", and "info" options are
available in this library, their uses are not nanosecond order of magnitude with logging off
that users may be used to with standard Log4j method calls. Therefore, they should be used
sparingly. Use of the "ifEnabled" tag does not improve this performance; this tag is available
to conditionally evaluate other actions in addition to logging actions.]]>
  Log4j 2 Tag Library
  1.0
  log
  http://logging.apache.org/log4j/tld/log

  
    Sets the default Logger to use for the rest of this JSP's execution OR exports
      an org.apache.logging.log4j.Logger instance as the specified EL variable. The "value"
      attribute specifies either the String name of a Logger to create or an actual Logger instance.
      By default, Loggers are constructed and assigned the standard
      org.apache.logging.log4j.message.ParameterizedMessageFactory. The optional "factory" attribute
      can be used to override the default message factory.
    setLogger
    org.apache.logging.log4j.taglib.SetLoggerTag
    empty
    
      The name or instance of the Logger to set as the JSP's default Logger or
        the name of the Logger to export as the specified EL variable.
      logger
      true
      true
      java.lang.Object
    
    
      Specify this optional tag to provide a message factory other than the default
        ParameterizedMessageFactory message factory to use for the Logger. If the Logger has already
        been created with a different message factory, this will be ignored. Using this attribute
        makes no sense if the "value" attribute's value is an actual Logger instance, since its
        message factory cannot be changed.
      factory
      false
      true
      org.apache.logging.log4j.message.MessageFactory
    
    
      The optional name of the EL variable to export this Logger as. Using this
        attribute makes no sense if the "value" attribute's value is an actual Logger instance.
        That would result in an existing Logger on the scope being re-added to the
        scope.
      var
      false
      false
      java.lang.String
    
    
      Either "page," "request," "session," or "application," the optional scope that
        the EL variable should be exported to (defaults to "page").
      scope
      false
      false
      java.lang.String
    
    



    ]]>
  

  
    Conditional tag that evaluates its body only if the specified log level and
      marker are enabled.
    ifEnabled
    org.apache.logging.log4j.taglib.IfEnabledTag
    JSP
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    
      The name of any valid Level (TRACE, DEBUG, INFO, etc.) or an actual Level
        instance to check whether it is enabled. This value is case-insensitive.
      level
      true
      true
      java.lang.Object
    
    
      Marker data to include in the enabled check.
      marker
      false
      true
      org.apache.logging.log4j.Marker
    
    
    Evaluate this content



    Evaluate this content

    ]]>
  

  
    Equivalent of org.apache.logging.log4j.Logger#catching().
    catching
    org.apache.logging.log4j.taglib.CatchingTag
    empty
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    
      The name of any valid level (TRACE, DEBUG, INFO, etc.) or an actual Level
        instance to log this at. This value is case-insensitive and defaults to ERROR for this
        tag.
      level
      false
      true
      java.lang.Object
    
    
      The exception that should be logged.
      exception
      true
      true
      java.lang.Throwable
    
    
    <%= 5 / 0 %>


    

    ]]>
  

  
    Equivalent of org.apache.logging.log4j.Logger#entry(). This tag has dynamic
      attributes enabled. You may specify any number of arbitrary attributes whose values
      will be logged with this entry (TRACE) statement. The attribute names will be
      ignored.
    entry
    org.apache.logging.log4j.taglib.EntryTag
    empty
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    true
    



    ]]>
  

  
    Equivalent of org.apache.logging.log4j.Logger#exit().
    exit
    org.apache.logging.log4j.taglib.ExitTag
    empty
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    
      An optional object to log with the exit (TRACE) statement.
      result
      false
      true
      java.lang.Object
    
    



    ]]>
  

  
    Equivalent of org.apache.logging.log4j.Logger#log(). This tag has dynamic
      attributes enabled. You may specify any number of arbitrary attributes whose values will be
      substituted in the String message. The "message" must be a String for this to work correctly.
      See the Log4j 2 manual for more information about message parameters and substitution. Only
      attribute values are used; attribute names are ignored.
    log
    org.apache.logging.log4j.taglib.LogTag
    JSP
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    
      The name of any valid level (TRACE, DEBUG, INFO, etc.) or an actual Level
        instance to log this at. This value is case-insensitive.
      level
      true
      true
      java.lang.Object
    
    
      The message that should be logged. May be a String, Object, or
        org.apache.logging.log4j.message.Message. Either this attribute or body content are
        required.
      message
      false
      true
      java.lang.Object
    
    
      Optional marker data to include in this logging event.
      marker
      false
      true
      org.apache.logging.log4j.Marker
    
    
      Optional exception that should be logged.
      exception
      false
      true
      java.lang.Throwable
    
    true
    


    Log this message

    ]]>
  

  
    Equivalent of org.apache.logging.log4j.Logger#trace(). This tag has dynamic
      attributes enabled. You may specify any number of arbitrary attributes whose values will be
      substituted in the String message. The "message" must be a String for this to work correctly.
      See the Log4j 2 manual for more information about message parameters and substitution. Only
      attribute values are used; attribute names are ignored.
    trace
    org.apache.logging.log4j.taglib.TraceTag
    JSP
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    
      The message that should be logged. May be a String, Object, or
        org.apache.logging.log4j.message.Message. Either this attribute or body content are
        required.
      message
      false
      true
      java.lang.Object
    
    
      Optional marker data to include in this logging event.
      marker
      false
      true
      org.apache.logging.log4j.Marker
    
    
      Optional exception that should be logged.
      exception
      false
      true
      java.lang.Throwable
    
    true
    


    Log this message

    ]]>
  

  
    Equivalent of org.apache.logging.log4j.Logger#debug(). This tag has dynamic
      attributes enabled. You may specify any number of arbitrary attributes whose values will be
      substituted in the String message. The "message" must be a String for this to work correctly.
      See the Log4j 2 manual for more information about message parameters and substitution. Only
      attribute values are used; attribute names are ignored.
    debug
    org.apache.logging.log4j.taglib.DebugTag
    JSP
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    
      The message that should be logged. May be a String, Object, or
        org.apache.logging.log4j.message.Message. Either this attribute or body content are
        required.
      message
      false
      true
      java.lang.Object
    
    
      Optional marker data to include in this logging event.
      marker
      false
      true
      org.apache.logging.log4j.Marker
    
    
      Optional exception that should be logged.
      exception
      false
      true
      java.lang.Throwable
    
    true
    


    Log this message

    ]]>
  

  
    Equivalent of org.apache.logging.log4j.Logger#info(). This tag has dynamic
      attributes enabled. You may specify any number of arbitrary attributes whose values will be
      substituted in the String message. The "message" must be a String for this to work correctly.
      See the Log4j 2 manual for more information about message parameters and substitution. Only
      attribute values are used; attribute names are ignored.
    info
    org.apache.logging.log4j.taglib.InfoTag
    JSP
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    
      The message that should be logged. May be a String, Object, or
        org.apache.logging.log4j.message.Message. Either this attribute or body content are
        required.
      message
      false
      true
      java.lang.Object
    
    
      Optional marker data to include in this logging event.
      marker
      false
      true
      org.apache.logging.log4j.Marker
    
    
      Optional exception that should be logged.
      exception
      false
      true
      java.lang.Throwable
    
    true
    


    Log this message

    ]]>
  

  
    Equivalent of org.apache.logging.log4j.Logger#warn(). This tag has dynamic
      attributes enabled. You may specify any number of arbitrary attributes whose values will be
      substituted in the String message. The "message" must be a String for this to work correctly.
      See the Log4j 2 manual for more information about message parameters and substitution. Only
      attribute values are used; attribute names are ignored.
    warn
    org.apache.logging.log4j.taglib.WarnTag
    JSP
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    
      The message that should be logged. May be a String, Object, or
        org.apache.logging.log4j.message.Message. Either this attribute or body content are
        required.
      message
      false
      true
      java.lang.Object
    
    
      Optional marker data to include in this logging event.
      marker
      false
      true
      org.apache.logging.log4j.Marker
    
    
      Optional exception that should be logged.
      exception
      false
      true
      java.lang.Throwable
    
    true
    


    Log this message

    ]]>
  

  
    Equivalent of org.apache.logging.log4j.Logger#error(). This tag has dynamic
      attributes enabled. You may specify any number of arbitrary attributes whose values will be
      substituted in the String message. The "message" must be a String for this to work correctly.
      See the Log4j 2 manual for more information about message parameters and substitution. Only
      attribute values are used; attribute names are ignored.
    error
    org.apache.logging.log4j.taglib.ErrorTag
    JSP
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    
      The message that should be logged. May be a String, Object, or
        org.apache.logging.log4j.message.Message. Either this attribute or body content are
        required.
      message
      false
      true
      java.lang.Object
    
    
      Optional marker data to include in this logging event.
      marker
      false
      true
      org.apache.logging.log4j.Marker
    
    
      Optional exception that should be logged.
      exception
      false
      true
      java.lang.Throwable
    
    true
    


    Log this message

    ]]>
  

  
    Equivalent of org.apache.logging.log4j.Logger#fatal(). This tag has dynamic
      attributes enabled. You may specify any number of arbitrary attributes whose values will be
      substituted in the String message. The "message" must be a String for this to work correctly.
      See the Log4j 2 manual for more information about message parameters and substitution. Only
      attribute values are used; attribute names are ignored.
    fatal
    org.apache.logging.log4j.taglib.FatalTag
    JSP
    
      The name or instance of the Logger to use to override the default Logger
        for this JSP.
      logger
      false
      true
      java.lang.Object
    
    
      The message that should be logged. May be a String, Object, or
        org.apache.logging.log4j.message.Message. Either this attribute or body content are
        required.
      message
      false
      true
      java.lang.Object
    
    
      Optional marker data to include in this logging event.
      marker
      false
      true
      org.apache.logging.log4j.Marker
    
    
      Optional exception that should be logged.
      exception
      false
      true
      java.lang.Throwable
    
    true
    


    Log this message

    ]]>
  

  
    Displays all variables bound to the specified scope.
    dump
    org.apache.logging.log4j.taglib.DumpTag
    empty
    
      Either "page," "request," "session," or "application," the scope whose bound
        variables should be dumped onto the page inline.
      scope
      true
      false
      java.lang.String
    
    



    ]]>
  






© 2015 - 2025 Weber Informatics LLC | Privacy Policy