JetBrains / ideolog

Interactive viewer for '.log' files.
MIT License
254 stars 55 forks source link

Log files with timestamps behind the file extension are not recognised #70

Open graue70 opened 5 years ago

graue70 commented 5 years ago

Problem

Files with names like

are not recognised as log files. Files with these kinds of names are automatically created by for example the logging.handlers.TimedRotatingFileHandler in python after a roll over.

Solution attempts

  1. Check whether the filename contains .log. OR ends with .log. (There will probably be false positives because of some filenames like my.log.program.py.)
  2. Check whether there is only some kind of timestamp behind the .log extension. (There will probably be false negatives because it is hard to name all kinds of timestamps.)
  3. Check whether most of the characters behind .log are numbers as this should cover most timestamps (except something like program.log.2019-August). (This should result in less false positives than option 1 and less false negatives than option 2.)
EmpireDemocratiqueDuPoulpe commented 1 year ago

Hi, This issue has been open for some time. I was looking for a solution to the same problem today (some of my log files did not end with .log), and I think I have found something.

In your IntelliJ IDE, go to File > Settings > Editor > File Types. Scroll down the list and click on the record named Log files. There, on the right, you can add a custom file extension. Save, and re-open your log file in your IDE, it should work fine. At least, that is the case for me.