Rework Internal Logger, support specifying absolute path for log base folder#763
Conversation
…add capability to specify absolute path, clean up
littleaj
left a comment
There was a problem hiding this comment.
The config elements BaseFolder and BaseFolderPath read as synonyms. I thought the design was to use BaseFolder and only root it under java.io.tmpdir if the path was relative. If it's absolute, then use that directly.
|
@littleaj I am not sure, if there is easy way to determine if the path is relative or absolute. Do you have any clue for that ? May be this ? https://stackoverflow.com/questions/7627049/how-to-check-whether-the-path-is-relative-or-absolute-in-java Though I am not sure, it feels to me a bit confusing with annonymously checking if the path is relative or absolute. |
|
@dhaval24, I'm not sure what you mean by "anonymously checking," but yes, that's the method I had in mind. The idea was to support the current way (where everything is relative to temp) and add the functionality which supports absolute paths. I don't think we should reject relative paths since they work currently. |
|
@littleaj in my modification, if you use just specify the base folder name, it would be relative to temp folder, so I believe in that way currently functionality is preserved. |
|
Thanks @littleaj ! I understand your concern. Is it possible for us to brainstorm a better solution together. Would you mind throwing your ideas ? One I have on top of mind is to just use What is the downside of just supporting absolute path? I would like to understand better. I am happy to alter solution as per the combined decision. Thanks! |
littleaj
left a comment
There was a problem hiding this comment.
Two main points:
- There were some best practice comments which could lead to tests giving false positives after certain changes.
- Consider adjusting your IDE settings to be less intrusive with optimizing imports and the like. There were quite a few changes which had nothing to do with this feature.
…tants in tests
<BaseFolderPath><BaseFolderName>tag in favor of<BaseFolderPath>Sample usage for agent:
Sample usage for core:
sample usage for SpringBoot starter:
Note: It is essential to specify separate folder for AgentLogging and SDKLogging. This doesn't fix the logging in the
AgentImplementation.javaclass.For significant contributions please make sure you have completed the following items: