Open bpringe opened 3 years ago
clojure-lsp
uses java.io temp folder when initializing if user doesn't provide a :log-path
, that's why you have different clojure-lsp logs, because every time you initialize clojure-lsp it will create a different log path unless you provide a log-path
.
We made this way because we started to have issues with users without permission on /tmp/
folder, so we couldn't always set the log to there.
I'm a bit confused on multiple levels. You're saying we can provide an exact file path, like /tmp/clojure-lsp.out
and clojure-lsp will always log to that single file? I figured the separate files were to keep the log files under a certain size or something :smile:. If we made it always log to a certain file, does it ever clear this file or the file just grows infinitely? (I'm really just curious here.)
We made this way because we started to have issues with users without permission on /tmp/ folder, so we couldn't always set the log to there.
It defaults to A JVM tmp path, usually /tmp/clojure-lsp.*.out
... and then if the user has a permission issue they can change it?
If we are to create a method for displaying the log file, I'm guessing we can get the :log-path
from the server info command, then open it. Does that sound like a good approach?
Yes, it grows infinitely and this was never an issue since clojure-lsp doesn't log that much.
It defaults to A JVM tmp path, usually /tmp/clojure-lsp.*.out... and then if the user has a permission issue they can change it?
No, actually it defaults for JVM tmp path which most of the time is /tmp
but for some macos for example it's /var/log/...
. The thing here is, we will never face permission issues with that.
If we are to create a method for displaying the log file, I'm guessing we can get the :log-path from the server info command, then open it. Does that sound like a good approach?
Yes, it sounds perfect! I didn't think about that option 😅
Sometimes Calva users run into issues that are related (or may be) to clojure-lsp, and we have to inform them of where the log files are and ask that they send log info. It would be nice if Calva assisted with getting these logs.
@ericdallo There isn't just one log file though, right? I see many in my
/tmp
directory like:So, I'm not sure what the best path here is for making it convenient to get the recent logs (assuming the most recent file is the one we want).
Some ideas:
tail
the latest file, though if a new file is created in the middle of this, that could complicate things I imagineWhat other things could we do?