Skip to content
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

Security Log file option #407

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Security Log file option #407

merged 1 commit into from
Jan 18, 2024

Conversation

Pietfried
Copy link
Contributor

Added option for writing SecurityEvents to a security log file for ocpp1.6 and ocpp2.0.1.
This can be enabled by adding "security" to LogMessagesFormat configuration parameter.

@Pietfried Pietfried force-pushed the feature/security-log-file branch from 4817df3 to 9a15914 Compare January 18, 2024 15:41
@Pietfried Pietfried requested a review from hikinggrass January 18, 2024 16:30
@Pietfried Pietfried merged commit 7fa3cb9 into main Jan 18, 2024
3 of 4 checks passed
@Pietfried Pietfried deleted the feature/security-log-file branch January 18, 2024 16:30
@@ -69,6 +70,10 @@ MessageLogging::MessageLogging(
"</style>";
this->html_log_file << "</head><body><table class=\"log\">\n";
}
if (this->log_security) {
EVLOG_info << "Logging SecurityEvents to file";
this->security_log_file.open(message_log_path + "/" + output_file_name + ".security.log");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see this overwrites the old already existing security log as it does not append?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or is the output_file_name different for each run?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 1.6 (and 2.0.1) the output_file_name is set to the current datetime:

this->logging = std::make_shared<ocpp::MessageLogging>(

So it's very likely different for each run

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

Successfully merging this pull request may close these issues.

3 participants