Class AccessLog

java.lang.Object
net.vincent.communidirect.server.AccessLog

public class AccessLog extends Object
Records inbound connection events to a flat-text access log file.

Each call to logAccess(Socket) appends a single line containing a timestamp and the remote IP address.

Note: The underlying FileWriter is opened without the append flag, so each invocation overwrites the previous content. This is intentional for the current lightweight logging design.

  • Constructor Details

    • AccessLog

      public AccessLog(ServerLauncher serverLauncher)
      Constructs an AccessLog. Call init(String) before logging any events.
      Parameters:
      serverLauncher - the owning server launcher instance
  • Method Details

    • init

      public void init(String logFile)
      Configures the log file destination. Must be called once before any calls to logAccess(Socket).
      Parameters:
      logFile - absolute path to the log file to write
    • logAccess

      public void logAccess(Socket clientSocket)
      Appends a timestamped access entry for the given socket's remote address.
      Parameters:
      clientSocket - the accepted client socket whose IP is recorded