001/** 002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 003 * 004 * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved 005 * 006 * The contents of this file are subject to the terms 007 * of the Common Development and Distribution License 008 * (the License). You may not use this file except in 009 * compliance with the License. 010 * 011 * You can obtain a copy of the License at 012 * https://opensso.dev.java.net/public/CDDLv1.0.html or 013 * opensso/legal/CDDLv1.0.txt 014 * See the License for the specific language governing 015 * permission and limitations under the License. 016 * 017 * When distributing Covered Code, include this CDDL 018 * Header Notice in each file and include the License file 019 * at opensso/legal/CDDLv1.0.txt. 020 * If applicable, add the following below the CDDL Header, 021 * with the fields enclosed by brackets [] replaced by 022 * your own identifying information: 023 * "Portions Copyrighted [year] [name of copyright owner]" 024 * 025 * $Id: LogConstants.java,v 1.16 2008/09/18 22:56:31 veiming Exp $ 026 * 027 * Portions Copyrighted 2011-2014 ForgeRock AS 028 * Portions Copyrighted 2013 Cybernetica AS. 029 * Portions Copyrighted 2014 Nomura Research Institute, Ltd 030 */ 031package com.sun.identity.log; 032 033import java.util.logging.Level; 034 035/** 036 * Defines constants used in the Logging service. <tt> LogConstants </TT> 037 * helps in maintaining a central repository of all the constants used in the 038 * package. 039 * @supported.api 040 */ 041public class LogConstants { 042 /** 043 * Attribute defining the maximum (flat) file size, above which 044 * the files are either archived or rotated. 045 * @supported.api 046 */ 047 public static final String MAX_FILE_SIZE = 048 "iplanet-am-logging-max-file-size"; 049 /** 050 * Attribute defining the location where the logs go. 051 * @supported.api 052 */ 053 public static final String LOG_LOCATION = "iplanet-am-logging-location"; 054 /** 055 * Constant for the default base directory "prefix" 056 * for Flat File logging, indicating that the instance's 057 * Configuration directory + server URI should be used. 058 */ 059 public static final String DEF_FF_LOG_LOC_BASE = "CONFIG_DIR_SERVER_URI"; 060 /** 061 * Attribute defining whether the logs to be stored in 062 * flat-files or to a Database. 063 * @supported.api 064 */ 065 public static final String BACKEND = "iplanet-am-logging-type"; 066 /** 067 * Attribute defining the user name of the database (for 068 * authenticating to the Database) 069 */ 070 public static final String DB_USER = "iplanet-am-logging-db-user"; 071 /** 072 * Attribute defining the password for the user of the db 073 * (for authenticating to DB) 074 */ 075 public static final String DB_PASSWORD = "iplanet-am-logging-db-password"; 076 /** 077 * Attribute defining the Database Driver. 078 * @supported.api 079 */ 080 public static final String DB_DRIVER = "iplanet-am-logging-db-driver"; 081 /** 082 * Attribute defining the currently present list of logs in the Directory. 083 */ 084 public static final String LOG_LIST = "iplanet-am-logging-log-list"; 085 /** 086 * Attribute defining the set of all fields being logged. These fields are 087 * predefined to be time, Date, LoginID, Domain, LogLevel, Data, IPAddr, 088 * and HostName. 089 * @supported.api 090 */ 091 public static final String ALL_FIELDS = "iplanet-am-logging-allfields"; 092 /** 093 * Attribute defining the fields currently selected by the administrator 094 * to be logged. 095 * @supported.api 096 */ 097 public static final String LOG_FIELDS = "iplanet-am-logging-logfields"; 098 /** 099 * Attribute defining the FileHandler class 100 */ 101 public static final String FILE_HANDLER = 102 "iplanet-am-logging-file-handler"; 103 /** 104 * Attribute defining the Database Handler class 105 */ 106 public static final String DB_HANDLER = "iplanet-am-logging-jdbc-handler"; 107 /** 108 * Attribute defining the Syslog Handler class. 109 */ 110 public static final String SYSLOG_HANDLER = "iplanet-am-logging-syslog-handler"; 111 /** 112 * Attribute defining the number of history files a (flat file) 113 * log should have. 114 * @supported.api 115 */ 116 public static final String NUM_HISTORY_FILES = 117 "iplanet-am-logging-num-hist-file"; 118 /** 119 * Attribute defining the RemoteHandler class 120 */ 121 public static final String REMOTE_HANDLER = 122 "iplanet-am-logging-remote-handler"; 123 /** 124 * Default value for remote handler class 125 */ 126 public static final String DEFAULT_REMOTE_HANDER = 127 "com.sun.identity.log.handlers.RemoteHandler"; 128 129 /** 130 * Attribute defining the ELFFormatter class. 131 * (OpenSSO ELF Formatting. Hence FHandler 132 * should be associated with a ELFFormatter). 133 */ 134 public static final String ELF_FORMATTER = 135 "iplanet-am-logging-elf-formatter"; 136 137 /** 138 * Attribute defining the RemoteFormatter class which creates a 139 * xml string for a log action and sends it across to the remote 140 * OpenSSO. 141 */ 142 public static final String REMOTE_FORMATTER = 143 "iplanet-am-logging-remote-formatter"; 144 /** 145 * Default value for remote formatter class 146 */ 147 public static final String DEFAULT_REMOTE_FORMATTER = 148 "com.sun.identity.log.handlers.RemoteFormatter"; 149 /** 150 * Attribute defining the DBFormatter class 151 */ 152 public static final String DB_FORMATTER = 153 "iplanet-am-logging-db-formatter"; 154 /** 155 * Attribute defining the SyslogFormatter class 156 */ 157 public static final String SYSLOG_FORMATTER = "iplanet-am-logging-syslog-formatter"; 158 /** 159 * Attribute defining the Authorization class used to see if a particular 160 * user is authorized to perform a particular task. 161 */ 162 public static final String AUTHZ = "iplanet-am-logging-authz-class"; 163 /** 164 * Attribute defining the Token Class used to generate a Token internally 165 * for use within the logging components. 166 */ 167 public static final String TOKEN_PROVIDER = 168 "iplanet-am-logging-token-class"; 169 /** 170 * Attribute defining the Archiver class 171 * 172 */ 173 public static final String ARCHIVER = "iplanet-am-logging-archiver-class"; 174 /** 175 * Platform attribute defining the locale 176 */ 177 public static final String LOCALE = 178 "iplanet-am-platform-locale"; 179 /** 180 * Naming attribute defining the logging service url. 181 */ 182 public static final String LOGGING_SERVICE_URL = 183 "iplanet-am-naming-logging-url"; 184 /** 185 * Defines CarriageReturn/LineFeed characters. 186 * @supported.api 187 */ 188 public static final String CRLF = "\r\n"; 189 /** 190 * Defines the LoggingService name. 191 * @supported.api 192 */ 193 public static final String LOGGING_SERVICE = "Logging"; 194 /** 195 * Defines the LoggingService name. 196 */ 197 public static final String MAC_FIELDNAME = "MAC"; 198 /** 199 * Defines the LoggingService name. 200 */ 201 public static final String SIGNATURE_FIELDNAME = "Signature"; 202 /** 203 * Defines the secure LoggingService log verify period. 204 */ 205 public static final String LOGVERIFY_PERIODINSECONDS = 206 "iplanet-am-logging-verify-period-in-seconds"; 207 208 public static final long LOGVERIFY_PERIODINSECONDS_DEFAULT = 3600; 209 210 /** 211 * Defines the LogSign period in seconds. 212 */ 213 public static final String LOGSIGN_PERIODINSECONDS = 214 "iplanet-am-logging-signature-period-in-seconds"; 215 216 public static final long LOGSIGN_PERIODINSECONDS_DEFAULT = 600; 217 218 /** 219 * Attribute defining the Log Security status; ON or OFF. 220 */ 221 public static final String SECURITY_STATUS = 222 "iplanet-am-logging-security-status"; 223 224 /** 225 * Defines the File Read Handler class. 226 */ 227 public static final String FILE_READ_HANDLER = 228 "iplanet-am-logging-file-read-handler"; 229 /** 230 * Defines the Secure File Handler class. 231 */ 232 public static final String SECURE_FILE_HANDLER = 233 "iplanet-am-logging-secure-file-handler"; 234 /** 235 * Defines the Secure ELF Formatter class. 236 */ 237 public static final String SECURE_ELF_FORMATTER = 238 "iplanet-am-logging-secure-elf-formatter"; 239 /** 240 * Defines the DB Read Handler class. 241 */ 242 public static final String DB_READ_HANDLER = 243 "sun-am-logging-db-read-handler"; 244 245 /** 246 * Attribute defining the maximum records for flat file logs. 247 * Also the default number of maximum records to be read. 248 */ 249 public static final String MAX_RECORDS = "iplanet-am-logging-max-records"; 250 251 /** 252 * Default max records if none entered 253 */ 254 public static final String MAX_RECORDS_DEFAULT = "500"; 255 /** 256 * Default max records, int version 257 */ 258 public static final int MAX_RECORDS_DEFAULT_INT = 500; 259 260 /** 261 * Attribute defining the number of files per keystore after which 262 * the keystore should be reinitialized. 263 */ 264 public static final String FILES_PER_KEYSTORE = 265 "iplanet-am-logging-files-per-keystore"; 266 267 /** 268 * Attribute defining the Class that implements what the 269 * Verifier does when verification fails 270 */ 271 public static final String VERIFIER_ACTION_CLASS = 272 "iplanet-am-logging-verifier-action-class"; 273 274 /** 275 * Attribute defining the Directory where the logger certificate 276 * store is stored. 277 */ 278 public static final String LOGGER_CERT_STORE = 279 "iplanet-am-logging-secure-certificate-store"; 280 281 /** 282 * Attribute defining the Class that implements the custom 283 * debug method in the case of log failure. 284 * @supported.api 285 */ 286 public static final String DEBUG_IMPL_CLASS = 287 "iplanet-am-logging-debug-class"; 288 /** 289 * Logging property prefix. 290 */ 291 public static final String LOG_PROP_PREFIX = 292 "iplanet-am-logging"; 293 /** 294 * Attribute defining the Buffer size. 295 * @supported.api 296 */ 297 public static final String BUFFER_SIZE = "iplanet-am-logging-buffer-size"; 298 /** 299 * Attribute defining the Maximum LogRecords held in memory if 300 * DB logging fails. 301 * @supported.api 302 */ 303 public static final String DB_MEM_MAX_RECS = 304 "sun-am-logging-db-max-in-mem"; 305 /** 306 * Attribute defining the Buffering time. 307 * @supported.api 308 */ 309 public static final String BUFFER_TIME = 310 "iplanet-am-logging-buffer-time-in-seconds"; 311 public static final long BUFFER_TIME_DEFAULT = 3600; 312 /** 313 * Attribute defining the Time Buffering Status; ON or OFF. 314 * @supported.api 315 */ 316 public static final String TIME_BUFFERING_STATUS = 317 "iplanet-am-logging-time-buffering-status"; 318 /** 319 * Attribute defining the Filter Class Name 320 */ 321 public static final String FILTER_CLASS_NAME = 322 "iplanet-am-logging-filter-class-name"; 323 324 /** 325 * Attribute defining the Secure Timestamp generator class 326 */ 327 public static final String SECURE_TIMESTAMP_GENERATOR = 328 "iplanet-am-logging-secure-timestamp-generator"; 329 330 /** 331 * Attribute defining the secure log helper class 332 */ 333 public static final String SECURE_LOG_HELPER = 334 "iplanet-am-logging-secure-log-helper-class-name"; 335 336 /** 337 * Attribute defining the default secure log helper class 338 */ 339 public static final String SECURE_DEFAULT_LOG_HELPER = 340 "com.sun.identity.log.secure.SecureLogHelperJSSImpl"; 341 342 /** 343 * Attribute defining the security initializer class name 344 */ 345 public static final String SECURITY_INITIALIZER = 346 "iplanet-am-logging-security-initializer-class-name"; 347 348 /** 349 * Attribute defining the security signing algorithm 350 */ 351 public static final String SECURITY_SIGNING_ALGORITHM = 352 "iplanet-am-logging-secure-signing-algorithm"; 353 354 /** 355 * Attribute defining the default security signing algorithm 356 */ 357 public static final String DEFAULT_SECURITY_SIGNING_ALGORITHM = 358 "SHA1withRSA"; 359 360 /** 361 * Attribute defining the log file logging level 362 */ 363 public static final String LOGGING_LEVEL = "sun-am-log-level"; 364 365 /** 366 * Attribute defining the Oracle DB data type for the DATA field 367 */ 368 public static final String ORA_DBDATA_FIELDTYPE = 369 "sun-am-logging-oradbdata-fieldtype"; 370 371 /** 372 * Attribute defining the MySQL DB data type for the DATA field 373 */ 374 public static final String MYSQL_DBDATA_FIELDTYPE = 375 "sun-am-logging-mysqldbdata-fieldtype"; 376 377 /** 378 * Attribute defining the format for the Oracle DATE/TIME field 379 */ 380 public static final String ORA_DBDATETIME_FORMAT = 381 "sun-am-logging-ora-dbdate-format"; 382 383 /** 384 * Attribute defining the format for the MySQL DATE/TIME field 385 */ 386 public static final String MYSQL_DBDATETIME_FORMAT = 387 "sun-am-logging-mysql-dbdate-format"; 388 389 /** 390 * Attribute defining syslog host. 391 */ 392 public static final String SYSLOG_HOST = "iplanet-am-logging-syslog-host"; 393 394 /** 395 * Attribute defining syslog port. 396 */ 397 public static final String SYSLOG_PORT = "iplanet-am-logging-syslog-port"; 398 /** 399 * Attribute defining syslog protocol, UDP or TCP. 400 */ 401 public static final String SYSLOG_PROTOCOL = "iplanet-am-logging-syslog-protocol"; 402 403 /** 404 * Attribute defining syslog facility. 405 */ 406 public static final String SYSLOG_FACILITY = "iplanet-am-logging-syslog-facility"; 407 408 /** 409 * Attribute defining syslog connection timeout. 410 */ 411 public static final String SYSLOG_CONNECTION_TIMEOUT = "iplanet-am-logging-syslog-connection-timeout"; 412 413 /** 414 * Property defining whether logging is enabled 415 * @supported.api 416 */ 417 public static final String LOG_STATUS = 418 "com.iplanet.am.logstatus"; 419 420 /** 421 * Property defining Logging subdirectory. 422 */ 423 public static final String LOG_LOCATION_SUBDIR = 424 "com.sun.identity.log.logSubdir"; 425 426 public static final String LOG_READ = "READ"; 427 428 public static final String LOG_WRITE = "WRITE"; 429 430 public static final String LOG_CREATE = "CREATE"; 431 432 public static final String LOG_DELETE = "DELETE"; 433 434 /* 435 *logInfoMap keys 436 */ 437 438 /** 439 * The Date/Time field. This field is one of the two required in 440 * any log record. 441 * @supported.api 442 */ 443 public static final String TIME = "TIME"; 444 /** 445 * The Data field. This field is one of the two required in 446 * any log record. 447 * @supported.api 448 */ 449 public static final String DATA = "Data"; 450 /** 451 * The LogLevel field. The level at which the log record was 452 * logged. 453 * @supported.api 454 */ 455 public static final String LOG_LEVEL = "LogLevel"; 456 /** 457 * The Domain field. The AM Domain pertaining to the log record's 458 * Data field. 459 * @supported.api 460 */ 461 public static final String DOMAIN = "Domain"; 462 /** 463 * The LoginID field. The AM Login ID pertaining to the log record's 464 * Data field. 465 * @supported.api 466 */ 467 public static final String LOGIN_ID = "LoginID"; 468 /** 469 * The IPAddr field. The IP Address pertaining to the log record's 470 * Data field. 471 * @supported.api 472 */ 473 public static final String IP_ADDR = "IPAddr"; 474 /** 475 * The HostName field. The HostName pertaining to the log record's 476 * Data field. 477 * @supported.api 478 */ 479 public static final String HOST_NAME = "HostName"; 480 /** 481 * The ModuleName field. The AM Module pertaining to the log record's 482 * Data field. 483 * @supported.api 484 */ 485 public static final String MODULE_NAME = "ModuleName"; 486 /** 487 * The LoggedBy field. The ID associated with who logged the record. 488 * @supported.api 489 */ 490 public static final String LOGGED_BY = "LoggedBy"; 491 /** 492 * The ContextID field. The ID associated with the user's session 493 * that is the subject of this log record. 494 * @supported.api 495 */ 496 public static final String CONTEXT_ID = "ContextID"; 497 /** 498 * The NoSession field. Whether the authentication request was made with the noSession query parameter 499 * and that no permanent session was created when the authentication was successful. 500 */ 501 public static final String NO_SESSION = "NoSession"; 502 /** 503 * The MessageID field. The unique Message Identifier associated with 504 * this particular log record data field. 505 * @supported.api 506 */ 507 public static final String MESSAGE_ID = "MessageID"; 508 509 /** 510 * The NameID field. The Name Identifier associated with 511 * this particular log record data field. 512 * @supported.api 513 */ 514 public static final String NAME_ID = "NameID"; 515 516 /** 517 * The maximum number of fields in a "regular" record. 518 * Includes Time, Data, LogLevel, Domain, LoginID, IPAddr, 519 * HostName, ModuleName, LoggedBy, ContextID, MessageID, NameID. 520 * Be sure to increment if more fields are added. 521 * @supported.api 522 */ 523 public static final int MAX_FIELDS = 12; 524 525 public static final String LOGIN_ID_SID = "LoginIDSid"; 526 public static final String LOGGED_BY_SID = "LoggedBySid"; 527 528 public static final String DEFAULT_AGENT_FILE = "amAuthLog"; 529 public static final String REST_ACCESS = "amRest.access"; 530 public static final String REST_AUTHZ = "amRest.authz"; 531 public static final String POLICY_ACCESS = "amPolicy.access"; 532 public static final String CONSOLE_ACCESS = "amConsole.access"; 533 public static final String AUTHENTICATION_ACCESS = 534 "amAuthentication.access"; 535 public static final String AUTHENTICATION_ERROR = 536 "amAuthentication.error"; 537 public static final String PASSWORDRESET_ACCESS = 538 "amPasswordReset.access"; 539 public static final String SSO_ACCESS = "amSSO.access"; 540 public static final String ADMIN_ACCESS = "amAdmin.access"; 541 public static final String ADMIN_ERROR = "amAdmin.error"; 542 public static final String [] LOGFILENAMES = { 543 DEFAULT_AGENT_FILE, 544 REST_ACCESS, 545 REST_AUTHZ, 546 POLICY_ACCESS, 547 CONSOLE_ACCESS, 548 AUTHENTICATION_ACCESS, 549 AUTHENTICATION_ERROR, 550 PASSWORDRESET_ACCESS, 551 SSO_ACCESS, 552 ADMIN_ACCESS, 553 ADMIN_ERROR }; 554 555 public static final int NUM_RECORDS = 0; 556 public static final int NUM_BYTES = 1; 557 558 /** 559 * Key name for enable/disable Hostname resolution 560 */ 561 public static final String LOG_RESOLVE_HOSTNAME = 562 "com.sun.identity.log.resolveHostName"; 563 564 /** 565 * Attribute name for enable/disable Hostname resolution 566 */ 567 public static final String LOG_RESOLVE_HOSTNAME_ATTR = 568 "resolveHostName"; 569 570 /** 571 * Attribute name for logging status 572 */ 573 public static final String LOG_STATUS_ATTR = 574 "logstatus"; 575 576 /** 577 * the "Not Available" String for when a field is not provided 578 */ 579 public static final String NOTAVAIL = "Not Available"; 580 581 /** 582 * default logging level 583 */ 584 public static final String DEFAULT_LOGGING_LEVEL_STR = "INFO"; 585 public static final Level DEFAULT_LOGGING_LEVEL = Level.INFO; 586 587 /** 588 * logging start due to container starting 589 */ 590 public static final String START_LOG_NEW_LOGGER_NAME = 591 "LOG_START_NEW_LOGGER"; 592 /** 593 * logging ending due to container terminating 594 */ 595 public static final String END_LOG_NAME = "LOG_END"; 596 /** 597 * logging start due to logging configuration change 598 */ 599 public static final String START_LOG_CONFIG_NAME = "LOG_START_CONFIG"; 600 /** 601 * logging termination due to logging configuration change 602 */ 603 public static final String END_LOG_CONFIG_NAME = "LOG_END_CONFIG"; 604 605 /** 606 * System properties which specifies the log directory. 607 */ 608 public static final String SYS_PROP_LOG_DIR = "com.sun.identity.log.dir"; 609 /** 610 * Attribute defining the prefix for the logfiles 611 */ 612 public static final String LOGFILE_PREFIX = "openam-logging-file-prefix"; 613 /** 614 * Attribute defining the suffix for the logfiles. This should be a valid 615 * dateformat string. 616 */ 617 public static final String LOGFILE_SUFFIX = "openam-logging-file-suffix"; 618 /** 619 * Attribute defining the rotation interval in minutes. 620 */ 621 public static final String LOGFILE_ROTATION = "openam-logging-file-rotation"; 622 623 /** 624 * Key name for enable/disable log rotation. 625 */ 626 public static final String ENABLE_ROTATION = "openam-logging-file-rotation-enabled"; 627}
Copyright © 2010-2017, ForgeRock All Rights Reserved.