内に含まその他のドキュメントサポート リソース | PDF 文書ファイルをダウンロードする (909 KB)
Chapter 4 Logging FunctionsThis chapter provides a reference to public functions in the C SDK for logging on the local system or on Sun JavaTM System Access Manager. Function summaries include a short description, syntax, parameters and returns. The following functions are contained in the header file am_log.h: am_log_add_module()Adds a new module to the list of known logging modules. Syntax#include "am_log.h" AM_EXPORT am_status_t am_log_add_module(const char *name, am_log_module_id_t *id_ptr); ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
DetailsIf a module of the same name already exists, then the module ID of that module is returned. am_log_flush_remote_log()Flushes all the log records in the log buffer. Syntax#include "am_log.h" AM_EXPORT am_status_t am_log_flush_remote_log(); ParametersThis function takes no parameters: ReturnsThis function returns am_status_t with one of the following values:
am_log_init()Initializes logging. This must be called before using any am_log_* interfaces. If any SSO, authentication, or policy initialization functions, am_sso_init() , am_auth_init(), or am_policy_init(), is called, then am_log_init() does not need to be called separately. Any of those functions will call am_log_init() internally with the same properties parameter that was used to initialize SSO, authentication, or policy. See the agents documentation on parameters related to logging that can be used to initialize log. Syntax#include "am_log.h" AM_EXPORT am_status_t am_log_init(const am_properties_t log_init_params); ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
am_log_is_level_enabled()Determines whether a logging message at the specified level and associated with the specified module would be emitted. Syntax#include "am_log.h"
AM_EXPORT boolean_t
am_log_is_level_enabled(am_log_module_id_t moduleID,
am_log_level_t level);
ParametersThis function takes the following parameters:
ReturnsThis function returns boolean_t with one of the following values:
am_log_log()Log the given message for the given module and at the given level. Syntax#include "am_log.h"
AM_EXPORT boolean_t
am_log_log(am_log_module_id_t moduleID,
am_log_level_t level,
const char *format, ...);
ParametersThis function takes the following parameters:
ReturnsThis function returns boolean_t with one of the following values. The set of addition arguments needed by the format string either enumerated directly or passed using the standard va_list mechanism as appropriate to the call. DetailsThe message is emitted only if the current level of the specified module is greater than or equal to the specified level. am_log_log_record()Logs the given log record to the given log_name on the Access Manager. am_log_record_* interfaces can be used to set information in the log record. Syntax#include "am_log.h"
AM_EXPORT am_status_t am_log_log_record
(am_log_record_t record, const char *log_name, const char *logged_by_token_id);
Start here
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
am_log_record_add_loginfo()Updates the log record with additional information. Syntax#include "am_log.h"
AM_EXPORT am_status_t
am_log_record_add_loginfo(am_log_record_t record,
const char *key,
const char *value);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
am_log_record_create()Creates a log record and initializes it with the given log level and message. Syntax#include "am_log.h"
AM_EXPORT am_status_t am_log_record_create
(am_log_record_t *record_ptr, am_log_record_log_level_t log_level,
const char *message);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
am_log_record_destroy()Destroys the log record returned by am_log_record_create. Syntax#include "am_log.h" AM_EXPORT am_status_t am_log_record_destroy(am_log_record_t record); ParametersThis function takes the following parameter:
ReturnsThis function returns am_status_t with one of the following values:
am_log_record_populate()Updates the log record with user’s SSO token information. Syntax#include "am_log.h"
AM_EXPORT am_status_t
am_log_record_populate(am_log_record_t record,
const char *user_token_id);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
am_log_record_set_log_level()Convenience functions. Syntax#include "am_log.h"
AM_EXPORT am_status_t
am_log_record_set_log_level(am_log_record_t record,
am_log_record_log_level_t log_level);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
am_log_record_set_log_message()Convenience function. Syntax#include "am_log.h"
AM_EXPORT am_status_t
am_log_record_set_log_message(am_log_record_t record,
const char *message);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
am_log_record_set_loginfo_props()Updates the log record with additional information. Syntax#include "am_log.h"
AM_EXPORT am_status_t
am_log_record_set_loginfo_props(am_log_record_t record,
am_properties_t log_info);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
DetailsSets all log info values as properties map. The log_info is expected to have the required log info members as key value pairs and user is expected to delete the am_properties_t pointer only when he is done with amsdk. am_log_set_levels_from_string()Sets the logging level for the modules listed in specified string. Syntax#include "am_log.h" AM_EXPORT am_status_t am_log_set_levels_from_string(const char *module_level_string); ParametersThis function takes the following parameter:
ReturnsThis function returns am_status_t with one of the following values:
DetailsThe format of the string is: <ModuleName>[:<Level>][,<ModuleName>[:<Level>]]* Optional spaces may occur before and after any commas. am_log_set_log_file()Sets the name of the file to use for logging. Syntax#include "am_log.h" AM_EXPORT am_status_t am_log_set_log_file(const char *name); ParametersThis function takes the following parameter:
ReturnsThis function returns am_status_twith one of the following values:
DetailsIf the specified name is NULL or empty, then logging messages will be sent to the stderr stream. am_log_set_module_level()Sets the logging level for the specified module. Syntax#include "am_log.h"
AM_EXPORT am_log_level_t
am_log_set_module_level(am_log_module_id_t moduleID,
am_log_level_t level);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_log_level_t with one of the following values:
am_log_set_remote_info()Sets information about Access Manager log service for the remote log module. This must be called before calling am_log_message() with AM_LOG_REMOTE_MODULE as the log module. Otherwise use am_log_log() with a log record and SSO token ID to log to Access Manager. Syntax#include "am_log.h"
AM_EXPORT am_status_t
am_log_set_remote_info(const char *rem_log_url,
const char *sso_token_id,
const char *rem_log_name,
const am_properties_t log_props);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
am_log_vlog()Logs a message for the given module at the given level. Syntax#include "am_log.h"
AM_EXPORT boolean_t
am_log_vlog(am_log_module_id_t moduleID,
am_log_level_t level,
const char *format, ...);
ParametersThis function takes the following parameters:
ReturnsThe set of addition arguments needed by the format string either enumerated directly or passed using the standard va_list mechanism as appropriate to the call. DetailsThe message is emitted only if the current level of the specified module is greater than or equal to the specified level. |