Stay organized with collections
Save and categorize content based on your preferences.
Filter
public
interface
Filter
A Filter can be used to provide fine grain control over
what is logged, beyond the control provided by log levels.
Each Logger and each Handler can have a filter associated with it.
The Logger or Handler will call the isLoggable method to check
if a given LogRecord should be published. If isLoggable returns
false, the LogRecord will be discarded.
Summary
Public methods |
abstract
boolean
|
isLoggable(LogRecord record)
Check if a given log record should be published.
|
Public methods
isLoggable
public abstract boolean isLoggable (LogRecord record)
Check if a given log record should be published.
Parameters |
record |
LogRecord : a LogRecord |
Returns |
boolean |
true if the log record should be published. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Filter\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nFilter\n======\n\n\n`\npublic\n\n\ninterface\nFilter\n`\n\n\n`\n\n\n`\n\n|--------------------------|\n| java.util.logging.Filter |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA Filter can be used to provide fine grain control over\nwhat is logged, beyond the control provided by log levels.\n\n\nEach Logger and each Handler can have a filter associated with it.\nThe Logger or Handler will call the isLoggable method to check\nif a given LogRecord should be published. If isLoggable returns\nfalse, the LogRecord will be discarded.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[isLoggable](/reference/java/util/logging/Filter#isLoggable(java.util.logging.LogRecord))`(`[LogRecord](/reference/java/util/logging/LogRecord)` record) ` Check if a given log record should be published. |\n\nPublic methods\n--------------\n\n### isLoggable\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean isLoggable (LogRecord record)\n```\n\nCheck if a given log record should be published.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|---------------------------------|\n| `record` | `LogRecord`: a LogRecord \u003cbr /\u003e |\n\n| Returns ||\n|-----------|----------------------------------------------------|\n| `boolean` | true if the log record should be published. \u003cbr /\u003e |"]]