You might want to consider logging to a database, such as MySQL or one of the various "nosql" plain old tables.

(If your user base is "massive", there's paths to scaling with more servers or outside services like Amazon or Azure...)

In one table, you can have a row for each log entry, and a column with things like the time, the player, the action (log on, log off), or other events of interest.

This is convenient for aggregation of various metrics, it's exactly what databases are good at.

As for how often you switch to a fresh table, or delete your data, really depends on how full it's getting and if you have any privacy or data retention agreements with the players.

--
I was thinking of this a little more. For an easy an maybe good-enough approach, by all means just append to one file with log entries.

If there's threads involved, use a thread-safe queue of things to append, and then poll and append from just one place.

One file per day, and a folder for each year, as a wild guess to start, would probably be fine. Easy to think about, easy to label the folder & filenames appropriately, easy to grep.