You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Adwait Kumar Singh (Jira)" <ji...@apache.org> on 2021/06/22 08:12:00 UTC
[jira] [Created] (LOG4J2-3111) Filter which stops logging if
DiskUsage exceeds a particular threshold
Adwait Kumar Singh created LOG4J2-3111:
------------------------------------------
Summary: Filter which stops logging if DiskUsage exceeds a particular threshold
Key: LOG4J2-3111
URL: https://issues.apache.org/jira/browse/LOG4J2-3111
Project: Log4j 2
Issue Type: New Feature
Components: Filters
Reporter: Adwait Kumar Singh
This is a common scenario where in case a host's disk is getting full we may prefer to stop secondary responsibilities of a system like logging, to prevent the system from completely crashing.
I am proposing to add a DiskSpaceCheckingFilter which would take in a minimumDiskSpaceFree percentage threshold and would filter out events if the diskspace is full. We could use the Java File.getUsableSpace and File.getTotalSpace to calculate the disk free percentage, and since these operations are costly they could be run on a separate thread and keep updating a Atomic variable which stores the thresholds, which would be queried on every event.
Caveats of this Filter (an additional thread, performance impact due to checking a atomic variable etc) can be called out and left up to users discretion to use or not.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)