Simulate a mini search engine — every launch, search, and exit gets logged to a file with a timestamp | Workbook p.34
Create a Java application called search-engine-logger. The program prompts the user for a search term, over and over, until they type X to exit. Your program doesn't have to actually search anything — what it does is log every action to a file called logs.txt.
There are three kinds of actions to log:
• launch — written once, the moment the program starts
• search — written every time the user enters a search term
• exit — written once, when the user types X
Each log line starts with a timestamp in the format yyyy-MM-dd HH:mm:ss, followed by the action. For a search, the search term is appended after the word search. Example entries:
2026-04-22 12:42:20 launch
2026-04-22 12:42:45 search : How to use ChatGPT
2026-04-22 12:43:51 exit
Workbook 3a, p.34 — Exercise: Search Engine Logger