Skip to content

How can I get the log file directory at runtime? #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chucklu opened this issue Jul 29, 2020 · 2 comments
Closed

How can I get the log file directory at runtime? #170

chucklu opened this issue Jul 29, 2020 · 2 comments

Comments

@chucklu
Copy link

chucklu commented Jul 29, 2020

 loggerConfiguration = loggerConfiguration.ReadFrom.AppSettings(filePath: path);
                    var logger = loggerConfiguration.CreateLogger();
                    Log.Logger = logger;

After create the logger, I would like to get the log file directory from the logger. However, I checked the source code, find you encapsulate class with lots of private fields and initialize fields with constructor.
Then how could I get the LogFileDirectoy at runtime?
The PathRoller instance is a private field of RollingFileSink.

@chucklu
Copy link
Author

chucklu commented Jul 29, 2020

I can check the log file directory through watch window when debug program. However the access route are all private fields.
It's weird design for me, could you told me why you did not consider to sue public property?
image

@nblumhardt
Copy link
Member

Hi! This one's a duplicate of #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants