IT. Expert System.

Android Reference

SocketHandler


java.util.logging

Class SocketHandler



  • public class SocketHandler
    extends StreamHandler
    A handler that writes log messages to a socket connection.

    This handler reads the following properties from the log manager to initialize itself:

    • java.util.logging.ConsoleHandler.level specifies the logging level, defaults to Level.ALL if this property is not found or has an invalid value.
    • java.util.logging.SocketHandler.filter specifies the name of the filter class to be associated with this handler, defaults to null if this property is not found or has an invalid value.
    • java.util.logging.SocketHandler.formatter specifies the name of the formatter class to be associated with this handler, defaults to java.util.logging.XMLFormatter if this property is not found or has an invalid value.
    • java.util.logging.SocketHandler.encoding specifies the encoding this handler will use to encode log messages, defaults to null if this property is not found or has an invalid value.
    • java.util.logging.SocketHandler.host specifies the name of the host that this handler should connect to. There's no default value for this property.
    • java.util.logging.SocketHandler.encoding specifies the port number that this handler should connect to. There's no default value for this property.

    This handler buffers the outgoing messages, but flushes each time a log record has been published.

    This class is not thread-safe.

    • Constructor Detail

      • SocketHandler

        public SocketHandler()
                      throws IOException
        Constructs a SocketHandler object using the properties read by the log manager, including the host name and port number. Default formatting uses the XMLFormatter class and level is set to ALL.
        Throws:
        IOException - if failed to connect to the specified host and port.
        IllegalArgumentException - if the host name or port number is illegal.
      • SocketHandler

        public SocketHandler(String host,
                     int port)
                      throws IOException
        Constructs a SocketHandler object using the specified host name and port number together with other properties read by the log manager. Default formatting uses the XMLFormatter class and level is set to ALL.
        Parameters:
        host - the host name
        port - the port number
        Throws:
        IOException - if failed to connect to the specified host and port.
        IllegalArgumentException - if the host name or port number is illegal.
    • Method Detail

      • close

        public void close()
        Closes this handler. The network connection to the host is also closed.
        Overrides:
        close in class StreamHandler
      • publish

        public void publish(LogRecord record)
        Logs a record if necessary. A flush operation will be done afterwards.
        Overrides:
        publish in class StreamHandler
        Parameters:
        record - the log record to be logged.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 686 / 158781725. Delta: 0.03843 с