Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-2670 JMX monitoring logging no longer logs when disabled #2708

Merged
merged 2 commits into from May 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -153,7 +153,7 @@ public void event(Event event) {
* if enabled in the configuration.
*/
public void bootstrapMonitoringService() {
if (configuration != null) {
if (configuration != null && configuration.getEnabled().equalsIgnoreCase("true")) {
shutdownMonitoringService();//To make sure that there aren't multiple monitoring services running

executor = Executors.newScheduledThreadPool(1, new ThreadFactory() {
Expand Down
Expand Up @@ -41,7 +41,6 @@
import fish.payara.notification.healthcheck.HealthCheckResultEntry;
import fish.payara.notification.requesttracing.RequestTrace;
import fish.payara.nucleus.notification.configuration.NotifierType;
import fish.payara.nucleus.notification.domain.EventSource;
import fish.payara.nucleus.notification.domain.NotificationEventFactory;
import org.glassfish.api.StartupRunLevel;
import org.glassfish.hk2.runlevel.RunLevel;
Expand All @@ -52,6 +51,7 @@
import java.util.logging.Level;

/**
* Factory to build events for {@link LogNotifier}
* @author mertcaliskan
*/
@Service
Expand All @@ -63,7 +63,6 @@ void postConstruct() {
registerEventFactory(NotifierType.LOG, this);
}


@Override
protected LogNotificationEvent createEventInstance() {
return new LogNotificationEvent();
Expand All @@ -90,4 +89,11 @@ public LogNotificationEvent buildNotificationEvent(String name, List<HealthCheck

return notificationEvent;
}

@Override
public LogNotificationEvent buildNotificationEvent(Level level, String subject, String message, Object[] parameters) {
LogNotificationEvent event = super.buildNotificationEvent(level, subject, message, parameters);
event.setLevel(level);
return event;
}
}