This is my very first post now that I am a very happy elixir user.
I am currently using logger_file_backend to log events in my game server. Is it possible for me to have logs grouped (in my case, per game) in to multiple files? For example, game_0001.log, game_0002.log, and so on.
For note, if this creates a new atom then you can exhaust the atom supply in the VM. It’s best to use existing hardcoded atoms only unless your game_id range is very tiny, I’d say keep it to a thousand or less to be safe, but honestly hardcoding them via compile-time generation is best I’d think, something like:
valid_game_ids = 0..1000
for game_id <- valid_game_ids do
def get_game_atom(unquote(game_id)), do: unquote(:"game_#{game_id}")
end
def get_game_atom(game_id), do: throw {:invalid_game_id, game_id}