Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-7680

PatternLoggers should check if log level is enabled before doing work


    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: EJBCA 7.0.0, EJBCA 6.15.2
    • Component/s: None
    • Labels:


      We use two different PatternLogger implementations that both log transactions or audit for OCSP and WS at the DEBUG log level.

      Each type of logging can be enabled by setting a configuration property.

      Neither implementation checks if the Logger for this class will handle/show entries at this log level when enabled.

      It would make sense if the logger were disabled despite property file configuration if the DEBUG isn't enabled by the Logger implementation to avoid wasting work if these logger are enabled by their output is discarded.

      This would also enable the EJBCA container to enable/disable these loggers by purely setting DEBUG/INFO log level on these classes.

      It is reasonable to assume that production systems wont run with DEBUG enabled with the exception of explicitly configured classes like the ones used for this purpose.
      → Would potentially enable us to enable these values by default and deprecate their future use for a major version in a follow up ticket.

      • org.cesecore.certificates.ocsp.logging.PatternLogger used by org.cesecore.certificates.ocsp.logging.TransactionLogger when conf/ocsp.properties has ocsp.trx-log=true.
      • org.cesecore.certificates.ocsp.logging.PatternLogger used by org.cesecore.certificates.ocsp.logging.AuditLogger when conf/ocsp.properties has ocsp.audit-log=true.
      • org.ejbca.util.PatternLogger used by org.ejbca.core.protocol.ws.logger.TransactionLogger when conf/jaxws.properties has ejbcaws.trx-log=true.


          Issue Links



              • Assignee:
                johan Johan Eklund
                johan Johan Eklund
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created: