01
Assignment Overview
Create a Log File Analyzer application that reads, processes, and writes log files while demonstrating proper exception handling and file I/O techniques.
Skills Applied: Exception Handling (6.1), File I/O (6.2), and NIO (6.3) from Module 6.
Exceptions
Try-catch, custom exceptions, try-with-resources
File I/O
Readers, writers, streams, serialization
NIO
Paths, Files, channels, buffers
02
Requirements
Part 1: Exception Handling Framework (30 points)
- Create custom exceptions:
FileProcessingException,InvalidLogFormatException - Implement proper exception hierarchy
- Use try-with-resources for all file operations
- Log all exceptions with appropriate messages
Part 2: Log File Reader (35 points)
- Read log files using BufferedReader
- Parse log entries (timestamp, level, message)
- Filter logs by level (INFO, WARN, ERROR)
- Handle malformed log entries gracefully
Part 3: Report Generation (30 points)
- Generate summary reports in text format
- Count occurrences by log level
- Identify error patterns
- Write reports using PrintWriter
Part 4: NIO Operations (30 points)
- Use
Files.readAllLines()for small files - Implement directory watching for new log files
- Copy and backup processed files
- Use
PathandFilesAPI throughout
03
Submission Guidelines
Folder Structure: Submit all files in a folder named
assignment6_yourname
Required Files:
exceptions/- Custom exception classesLogEntry.java- Log entry modelLogFileReader.javaReportGenerator.javaFileWatcher.javaMain.javasample_logs/- Sample log files for testingREADME.txt
Ready to submit? Include sample log files for testing!
Submit Now
04
Grading Rubric
| Criteria | Points | Description |
|---|---|---|
| Exception Handling | 30 | Custom exceptions and proper handling |
| Log File Reader | 35 | Parsing and filtering functionality |
| Report Generation | 30 | Accurate statistics and file output |
| NIO Operations | 30 | Proper use of NIO API |
| Total | 125 |