Java Chat Messenger is a simple client-server chat application developed using Java Socket Programming. The application enables real-time communication between a client and a server over a TCP connection.
It also includes a chat logging feature, which records all exchanged messages into a log file for future reference.
This project demonstrates fundamental concepts of Java networking, I/O streams, and client-server architecture.
- Real-time communication between client and server
- TCP-based socket communication
- Console-based chat interface
- Automatic message logging to file
- Simple and lightweight architecture
- Easy to extend for multi-client systems
- Java
- Socket Programming
- Java IO Streams
- File Handling (FileWriter & BufferedWriter)
Java-Chat-Messenger-With-Log-Facility
│
├── src
│ └── chatmessenger
│ ├── Client.java
│ └── Server.java
│
├── logs
│ └── chat_log.txt
│
├── docs
│ └── project_overview.md
│
├── README.md
└── .gitignore
git clone https://github.com/yourusername/Java-Chat-Messenger-With-Log-Facility.git
cd Java-Chat-Messenger-With-Log-Facility/src/chatmessenger
javac Server.java
javac Client.java
java Server
java Client
- The Server starts and waits for a client connection on port
2100. - The Client connects to the server using a socket.
- Messages are exchanged between client and server through input/output streams.
- The server stores each message in chat_log.txt.
- Communication continues until the client terminates the session.
Example content stored in the log file:
Client : Hello
Server : Hi
Client : How are you?
Server : I am fine
The log file helps maintain a record of all chat communication.
Server
Server application is running...
Server is waiting for the client at port number 2100
Connection established with the Client...
Client says : Hello
Enter message for client :
Hi
Client
Client application is running...
Connection established with the Server...
Hello
Server says : Hi
- Support for multiple clients
- Graphical user interface using Java Swing
- Timestamped message logging
- Encrypted communication
- Message history retrieval
Sahil Rajaram Thorat Java Backend Developer (Fresher) Pune, Maharashtra, India
GitHub: https://github.com/SahilThorat11
This project is licensed under the MIT License.