List of usage examples for io.netty.handler.logging LogLevel TRACE
LogLevel TRACE
To view the source code for io.netty.handler.logging LogLevel TRACE.
Click Source Link
From source file:org.ow2.petals.bc.gateway.outbound.TransportClient.java
License:Open Source License
public TransportClient(final ServiceUnitDataHandler handler, final Bootstrap partialBootstrap, final Logger logger, final ClassResolver cr, final ProviderDomain pd) { this.logger = logger; this.pd = pd; final LoggingHandler debugs = new LoggingHandler(logger.getName() + ".client", LogLevel.TRACE); final LastLoggingHandler errors = new LastLoggingHandler(logger.getName() + ".errors"); final ObjectEncoder objectEncoder = new ObjectEncoder(); final Bootstrap _bootstrap = partialBootstrap.handler(new ChannelInitializer<Channel>() { @Override/*from ww w . j av a 2 s . co m*/ protected void initChannel(final @Nullable Channel ch) throws Exception { assert ch != null; // This mirror the protocol used in TransporterListener final ChannelPipeline p = ch.pipeline(); p.addFirst(HandlerConstants.LOG_DEBUG_HANDLER, debugs); p.addLast(objectEncoder); p.addLast(new ObjectDecoder(cr)); final AuthenticatorSSLHandler authHandler = new AuthenticatorSSLHandler(pd, logger, new DomainHandlerBuilder<ProviderDomain>() { @Override public ChannelHandler build(final ProviderDomain domain) { assert domain == pd; return new DomainHandler(); } }); authenticationFuture = authHandler.authenticationFuture(); p.addLast(HandlerConstants.DOMAIN_HANDLER, authHandler); p.addLast(HandlerConstants.LOG_ERRORS_HANDLER, errors); } }); assert _bootstrap != null; bootstrap = _bootstrap; }
From source file:org.pidome.server.system.network.http.HttpServer.java
/** * Start the http server.// w ww. j a va 2s. c o m */ @Override public void start() { getSocketServerBootstrapContext(1, 15).childHandler(new HttpServerInitializer()) .handler(new LoggingHandler(LogLevel.TRACE)) .bind(this.getIpAddress().getValue(), this.getPort().getValue()); LOG.info("'{}' started", getServiceName()); }
From source file:org.stem.net.Server.java
License:Apache License
public void start() { EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup(); ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class) .option(ChannelOption.SO_BACKLOG, 100).childOption(ChannelOption.SO_KEEPALIVE, true) .option(ChannelOption.TCP_NODELAY, true).handler(new LoggingHandler(LogLevel.TRACE)) .childHandler(new ChannelInitializer<SocketChannel>() { @Override/*from w w w .j a v a2s . c om*/ protected void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast(new PacketDecoder()).addLast(new PacketEncoder()) .addLast(new MessageDecoder()).addLast(new MessageEncoder()) .addLast(new MessageDispatcher()); } }); try { future = bootstrap.bind(socket).sync(); logger.info("Starting listening for clients on {}...", socket); channel = future.channel(); // Wait until server socket is closed. // channel.closeFuture().sync(); } catch (InterruptedException e) { e.printStackTrace(); throw new RuntimeException("Can't start server: ", e); } }
From source file:org.thingsplode.synapse.endpoint.EndpointBootstrap.java
License:Apache License
public EndpointBootstrap() throws InterruptedException, FileNotFoundException { BasicConfigurator.configure();// w w w. j av a2 s . c om this.ep = Endpoint.create("test", new Endpoint.ConnectionProvider(new InetSocketAddress("0.0.0.0", 8080))) .logLevel(LogLevel.TRACE).dataFormat(Endpoint.DataFormat.JSON).addTransport(Endpoint.Transport.HTTP) .enableFileHandler(System.getProperty("java.io.tmpdir")).enableSwagger("1.0", null); // .publish(new RpcEndpointImpl()) // .publish(new EndpointTesterService()) // .publish(new CrudTestEndpointService()) // .publish(new DummyMarkedEndpoint()) // .publish("/default/", new AbstractEventSink<Address>(Address.class) { // @Override // protected void eventReceived(Event<Address> event) { // System.out.println("Event Received: " + event.getBody()); // } // }); this.ep.start(); }