Search in sources :

Example 1 with LoggingServiceImpl

use of com.hazelcast.logging.impl.LoggingServiceImpl in project hazelcast by hazelcast.

the class DefaultNodeContext method createNetworking.

private Networking createNetworking(Node node) {
    LoggingServiceImpl loggingService = node.loggingService;
    ILogger logger = loggingService.getLogger(TcpServerConnectionChannelErrorHandler.class);
    ChannelErrorHandler errorHandler = new TcpServerConnectionChannelErrorHandler(logger);
    HazelcastProperties props = node.getProperties();
    return new NioNetworking(new NioNetworking.Context().loggingService(loggingService).metricsRegistry(node.nodeEngine.getMetricsRegistry()).threadNamePrefix(node.hazelcastInstance.getName()).errorHandler(errorHandler).inputThreadCount(props.getInteger(IO_INPUT_THREAD_COUNT)).inputThreadAffinity(newSystemThreadAffinity("hazelcast.io.input.thread.affinity")).outputThreadCount(props.getInteger(IO_OUTPUT_THREAD_COUNT)).outputThreadAffinity(newSystemThreadAffinity("hazelcast.io.output.thread.affinity")).balancerIntervalSeconds(props.getInteger(IO_BALANCER_INTERVAL_SECONDS)).writeThroughEnabled(props.getBoolean(IO_WRITE_THROUGH_ENABLED)).concurrencyDetection(node.nodeEngine.getConcurrencyDetection()));
}
Also used : TcpServerContext(com.hazelcast.internal.server.tcp.TcpServerContext) HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) TcpServerConnectionChannelErrorHandler(com.hazelcast.internal.server.tcp.TcpServerConnectionChannelErrorHandler) LoggingServiceImpl(com.hazelcast.logging.impl.LoggingServiceImpl) ILogger(com.hazelcast.logging.ILogger) NioNetworking(com.hazelcast.internal.networking.nio.NioNetworking) TcpServerConnectionChannelErrorHandler(com.hazelcast.internal.server.tcp.TcpServerConnectionChannelErrorHandler) ChannelErrorHandler(com.hazelcast.internal.networking.ChannelErrorHandler)

Example 2 with LoggingServiceImpl

use of com.hazelcast.logging.impl.LoggingServiceImpl in project hazelcast by hazelcast.

the class HttpPostCommandProcessor method handleLogLevelSet.

private void handleLogLevelSet(HttpPostCommand command) throws UnsupportedEncodingException {
    String[] params = decodeParamsAndAuthenticate(command, 3);
    String level = params[2];
    LoggingServiceImpl loggingService = (LoggingServiceImpl) getNode().getLoggingService();
    loggingService.setLevel(level);
    prepareResponse(command, response(SUCCESS, "message", "log level is changed"));
}
Also used : LoggingServiceImpl(com.hazelcast.logging.impl.LoggingServiceImpl)

Example 3 with LoggingServiceImpl

use of com.hazelcast.logging.impl.LoggingServiceImpl in project hazelcast by hazelcast.

the class TcpServerConnection_AbstractTest method setup.

@Before
public void setup() throws Exception {
    loggingService = new LoggingServiceImpl("somegroup", "log4j2", BuildInfoProvider.getBuildInfo(), true, null);
    logger = loggingService.getLogger(TcpServerConnection_AbstractTest.class);
    metricsRegistryA = newMetricsRegistry();
    tcpServerA = newMockTcpServer(metricsRegistryA);
    serverContextA = (MockServerContext) tcpServerA.getContext();
    addressA = serverContextA.getThisAddress();
    metricsRegistryB = newMetricsRegistry();
    tcpServerB = newMockTcpServer(metricsRegistryB);
    serverContextB = (MockServerContext) tcpServerB.getContext();
    addressB = serverContextB.getThisAddress();
    metricsRegistryC = newMetricsRegistry();
    tcpServerC = newMockTcpServer(metricsRegistryC);
    serverContextC = (MockServerContext) tcpServerC.getContext();
    addressC = serverContextC.getThisAddress();
    serializationService = new DefaultSerializationServiceBuilder().addDataSerializableFactory(TestDataFactory.FACTORY_ID, new TestDataFactory()).build();
}
Also used : DefaultSerializationServiceBuilder(com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder) LoggingServiceImpl(com.hazelcast.logging.impl.LoggingServiceImpl) TestDataFactory(com.hazelcast.internal.server.TestDataFactory) Before(org.junit.Before)

Example 4 with LoggingServiceImpl

use of com.hazelcast.logging.impl.LoggingServiceImpl in project hazelcast by hazelcast.

the class HttpGetCommandProcessor method handleLogLevel.

private void handleLogLevel(HttpGetCommand command) {
    LoggingServiceImpl loggingService = (LoggingServiceImpl) getNode().getLoggingService();
    Level level = loggingService.getLevel();
    prepareResponse(command, new JsonObject().add("logLevel", level == null ? null : level.getName()));
}
Also used : LoggingServiceImpl(com.hazelcast.logging.impl.LoggingServiceImpl) JsonObject(com.hazelcast.internal.json.JsonObject) Level(java.util.logging.Level)

Example 5 with LoggingServiceImpl

use of com.hazelcast.logging.impl.LoggingServiceImpl in project hazelcast by hazelcast.

the class HttpPostCommandProcessor method handleLogLevelReset.

private void handleLogLevelReset(HttpPostCommand command) throws UnsupportedEncodingException {
    decodeParamsAndAuthenticate(command, 2);
    LoggingServiceImpl loggingService = (LoggingServiceImpl) getNode().getLoggingService();
    loggingService.resetLevel();
    prepareResponse(command, response(SUCCESS, "message", "log level is reset"));
}
Also used : LoggingServiceImpl(com.hazelcast.logging.impl.LoggingServiceImpl)

Aggregations

LoggingServiceImpl (com.hazelcast.logging.impl.LoggingServiceImpl)6 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)2 HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)2 Before (org.junit.Before)2 Address (com.hazelcast.cluster.Address)1 BuildInfo (com.hazelcast.instance.BuildInfo)1 DefaultNodeExtension (com.hazelcast.instance.impl.DefaultNodeExtension)1 Node (com.hazelcast.instance.impl.Node)1 JsonObject (com.hazelcast.internal.json.JsonObject)1 ChannelErrorHandler (com.hazelcast.internal.networking.ChannelErrorHandler)1 NioNetworking (com.hazelcast.internal.networking.nio.NioNetworking)1 TestDataFactory (com.hazelcast.internal.server.TestDataFactory)1 TcpServerConnectionChannelErrorHandler (com.hazelcast.internal.server.tcp.TcpServerConnectionChannelErrorHandler)1 TcpServerContext (com.hazelcast.internal.server.tcp.TcpServerContext)1 ILogger (com.hazelcast.logging.ILogger)1 MemberVersion (com.hazelcast.version.MemberVersion)1 Level (java.util.logging.Level)1