-
Notifications
You must be signed in to change notification settings - Fork 59
Conversation
src/runtime/security/sasl_utils.cpp
Outdated
return SASL_OK; | ||
} | ||
|
||
ddebug_f("sasl log info: log level = {}, message = {}", logger_level_to_string(level), msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All logs are in DEBUG level? I think it;s needed to convert level
to related rdsn's log level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have thought about this. But the log level in sasl is not a one-to-one correspondence log level in rdsn.
log level in rdsn:
typedef enum dsn_log_level_t {
LOG_LEVEL_INFORMATION,
LOG_LEVEL_DEBUG,
LOG_LEVEL_WARNING,
LOG_LEVEL_ERROR,
LOG_LEVEL_FATAL,
LOG_LEVEL_COUNT,
LOG_LEVEL_INVALID
} dsn_log_level_t;
log level in sasl:
define SASL_LOG_NONE 0 /* don't log anything */
#define SASL_LOG_ERR 1 /* log unusual errors (default) */
#define SASL_LOG_FAIL 2 /* log all authentication failures */
#define SASL_LOG_WARN 3 /* log non-fatal warnings */
#define SASL_LOG_NOTE 4 /* more verbose than LOG_WARN */
#define SASL_LOG_DEBUG 5 /* more verbose than LOG_NOTE */
#define SASL_LOG_TRACE 6 /* traces of internal protocols */
#define SASL_LOG_PASS 7 /* traces of internal protocols, including passwords */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about?
SASL_LOG_ERR -> LOG_LEVEL_ERROR
SASL_LOG_FAIL/SASL_LOG_WARN -> LOG_LEVEL_WARNING
SASL_LOG_NOTE -> LOG_LEVEL_INFORMATION
othres -> LOG_LEVEL_DEBUG
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SASL_LOG_ERR -> LOG_LEVEL_ERROR
SASL_LOG_FAIL/SASL_LOG_WARN -> LOG_LEVEL_WARNING
SASL_LOG_NOTE -> LOG_LEVEL_DEBUG
othres -> LOG_LEVEL_INFORMATION
If the config of enable_auth is true, we should init sasl.
[security] + sasl_plugin_path =