How to shortner Erlang module file names in the logs?

Hi All

I’m using logger for my app and always see fullpath for module names:

2025-05-08T21:36:21.371089+02:00 [info] [/Users/zab/dev/kolu/src/kolu.erl.233] a09ed09367c0=put(11111720002-DrillDoctor)
2025-05-08T21:36:21.394698+02:00 [info] [/Users/zab/dev/kolu/src/kolu.erl.233] 57fc0bebd02f=put(1T10412-DisqueFIBRE)
2025-05-08T21:36:21.417419+02:00 [info] [/Users/zab/dev/kolu/src/kolu.erl.233] 809909a110d8=put(XT50124-Lame)
2025-05-08T21:36:21.428157+02:00 [info] [/Users/zab/dev/kolu/src/kolu.erl.233] 8c508ec36bae=put(1143672-Foret)

How can I get the basename only in the logs? Something like this:

2025-05-08T21:36:21.371089+02:00 [info] [kolu.erl.233] a09ed09367c0=put(11111720002-DrillDoctor)
2025-05-08T21:36:21.394698+02:00 [info] [kolu.erl.233] 57fc0bebd02f=put(1T10412-DisqueFIBRE)
2025-05-08T21:36:21.417419+02:00 [info] [kolu.erl.233] 809909a110d8=put(XT50124-Lame)
2025-05-08T21:36:21.428157+02:00 [info] [kolu.erl.233] 8c508ec36bae=put(1143672-Foret)

Thanks
/Zab

This was easy after all:

#{file => ?MODULE_STRING, ...}
1 Like