-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
454 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version=2023.8 | ||
version=2023.9 | ||
# | ||
# tools | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ HiveMQ uses the following third party libraries: | |
com.sun.activation:jakarta.activation | 1.2.2 | BSD-3-Clause | https://www.eclipse.org/org/documents/edl-v10.php | ||
com.sun.xml.bind:jaxb-impl | 2.3.8 | BSD-3-Clause | https://www.eclipse.org/org/documents/edl-v10.php | ||
commons-io:commons-io | 2.13.0 | Apache-2.0 | https://spdx.org/licenses/Apache-2.0.html | ||
io.dropwizard.metrics:metrics-core | 4.2.19 | Apache-2.0 | https://spdx.org/licenses/Apache-2.0.html | ||
io.dropwizard.metrics:metrics-core | 4.2.22 | Apache-2.0 | https://spdx.org/licenses/Apache-2.0.html | ||
io.dropwizard.metrics:metrics-jmx | 4.2.19 | Apache-2.0 | https://spdx.org/licenses/Apache-2.0.html | ||
io.dropwizard.metrics:metrics-logback | 4.2.19 | Apache-2.0 | https://spdx.org/licenses/Apache-2.0.html | ||
io.github.microutils:kotlin-logging | 1.4.1 | Apache-2.0 | https://spdx.org/licenses/Apache-2.0.html | ||
|
@@ -56,7 +56,7 @@ HiveMQ uses the following third party libraries: | |
org.jetbrains.xodus:xodus-utils | 1.2.3 | Apache-2.0 | https://spdx.org/licenses/Apache-2.0.html | ||
org.rocksdb:rocksdbjni | 7.4.5 | Apache-2.0 | https://spdx.org/licenses/Apache-2.0.html | ||
org.slf4j:jul-to-slf4j | 2.0.7 | MIT | https://spdx.org/licenses/MIT.html | ||
org.slf4j:slf4j-api | 2.0.7 | MIT | https://spdx.org/licenses/MIT.html | ||
org.slf4j:slf4j-api | 2.0.9 | MIT | https://spdx.org/licenses/MIT.html | ||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
The open source code of the libraries can be obtained by sending an email to [email protected]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/main/java/com/hivemq/logging/LogLevelModifierTurboFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2019-present HiveMQ GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.hivemq.logging; | ||
|
||
import ch.qos.logback.classic.Level; | ||
import ch.qos.logback.classic.Logger; | ||
import ch.qos.logback.classic.turbo.TurboFilter; | ||
import ch.qos.logback.core.spi.FilterReply; | ||
import com.hivemq.extension.sdk.api.annotations.NotNull; | ||
import com.hivemq.extension.sdk.api.annotations.Nullable; | ||
import com.hivemq.logging.modifier.LogLevelModifier; | ||
import org.slf4j.Marker; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.CopyOnWriteArrayList; | ||
|
||
public class LogLevelModifierTurboFilter extends TurboFilter { | ||
|
||
private final @NotNull List<LogLevelModifier> logLevelModifiers = new CopyOnWriteArrayList<>(); | ||
|
||
@Override | ||
public @NotNull FilterReply decide( | ||
final @Nullable Marker marker, | ||
final @NotNull Logger logger, | ||
final @NotNull Level level, | ||
final @Nullable String format, | ||
final @Nullable Object @Nullable [] params, | ||
final @Nullable Throwable t) { | ||
|
||
FilterReply filterReply = FilterReply.NEUTRAL; | ||
|
||
if (format == null || level == Level.OFF) { | ||
// format is the log message | ||
return filterReply; | ||
} | ||
|
||
for (final LogLevelModifier logLevelModifier : logLevelModifiers) { | ||
filterReply = logLevelModifier.decide(marker, logger, level, format, params, t); | ||
if (filterReply != FilterReply.NEUTRAL) { | ||
return filterReply; | ||
} | ||
} | ||
return filterReply; | ||
} | ||
|
||
public void registerLogLevelModifier(final @NotNull LogLevelModifier logLevelModifier) { | ||
logLevelModifiers.add(logLevelModifier); | ||
} | ||
} |
Oops, something went wrong.