00001 /* 00002 * ALMA - Atacama Large Millimiter Array 00003 * (c) European Southern Observatory, 2002 00004 * Copyright by ESO (in the framework of the ALMA collaboration) 00005 * and Cosylab 2002, All rights reserved 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00020 * MA 02111-1307 USA 00021 */ 00022 #ifndef _LOGGING_IDL 00023 #define _LOGGING_IDL 00024 00025 #include <DsLogAdmin.idl> 00026 00027 #pragma prefix "alma" 00028 00029 00030 00048 module AcsLogLevels { 00049 00050 typedef short logLevelValue; 00051 00052 const logLevelValue TRACE_VAL = 1; 00053 const string TRACE_NAME = "Trace"; 00054 00055 // see COMP-3749 which describes this introduction of a new level between TRACE and DEBUG after ACS 8.1.0 00056 const logLevelValue DELOUSE_VAL = 2; 00057 const string DELOUSE_NAME = "Delouse"; 00058 00059 const logLevelValue DEBUG_VAL = 3; 00060 const string DEBUG_NAME = "Debug"; 00061 00062 const logLevelValue INFO_VAL = 4; 00063 const string INFO_NAME = "Info"; 00064 00065 const logLevelValue NOTICE_VAL = 5; 00066 const string NOTICE_NAME = "Notice"; 00067 00068 const logLevelValue WARNING_VAL = 6; 00069 const string WARNING_NAME = "Warning"; 00070 00071 // anomaly: value 7 is not defined! 00072 00073 const logLevelValue ERROR_VAL = 8; 00074 const string ERROR_NAME = "Error"; 00075 00076 const logLevelValue CRITICAL_VAL = 9; 00077 const string CRITICAL_NAME = "Critical"; 00078 00079 const logLevelValue ALERT_VAL = 10; 00080 const string ALERT_NAME = "Alert"; 00081 00082 const logLevelValue EMERGENCY_VAL = 11; 00083 const string EMERGENCY_NAME = "Emergency"; 00084 00085 // The OFF value of 99 is more human friendly. Technically it would make more sense 00086 // to define OFF_VAL as the maximum allowed value (2^15 - 1). 00087 const logLevelValue OFF_VAL = 99; 00088 const string OFF_NAME = "Off"; 00089 }; 00090 00091 00095 module ACSLoggingLog { 00096 00097 struct NameValue { 00098 string name; 00099 string value; // any ? -> use than Property from Property Service 00100 }; 00101 00102 typedef sequence<NameValue> NameValueSeq; 00103 00109 /* 00110 enum LogType { 00111 Unknown, 00112 Shutdown, 00113 Trace, 00114 Debug, 00115 Info, 00116 Notice, 00117 Warning, 00118 Startup, 00119 Error, 00120 Critical, 00121 Alert, 00122 Emergency, 00123 Archive 00124 }; 00125 */ 00126 /* 00127 Header, 00128 Description, 00129 History, 00130 Meta, 00131 Data, 00132 Alarm, 00133 */ 00134 00138 struct LogBinaryRecord { 00139 AcsLogLevels::logLevelValue type; 00140 string TimeStamp; 00141 string File; 00142 unsigned long Line; 00143 string Routine; 00144 string SourceObject; 00145 string Host; 00146 string Process; 00147 string LogContext; 00148 string Thread; 00149 string StackId; 00150 long StackLevel; 00151 string LogId; 00152 long Priority; 00153 string Uri; 00154 string Audience; 00155 string Array; 00156 string Antenna; 00157 string MsgData; 00158 00162 NameValueSeq attributes; 00163 NameValueSeq log_data; 00164 00165 }; 00166 00167 }; 00168 00169 00170 module Logging 00171 { 00175 typedef sequence <string> stringSeq; 00176 00177 exception LoggerDoesNotExistEx 00178 { 00179 string LoggerName; 00180 }; 00181 00182 exception IllegalLogLevelsEx 00183 { 00184 string ErrorDesc; 00185 }; 00186 00205 interface LoggingConfigurable { 00206 00207 /* 00208 * Struct that represents log level thresholds used for filtering log records. 00209 */ 00210 struct LogLevels { 00216 boolean useDefault; 00218 AcsLogLevels::logLevelValue minLogLevel; 00220 AcsLogLevels::logLevelValue minLogLevelLocal; 00221 }; 00222 00228 LogLevels get_default_logLevels(); 00229 00234 void set_default_logLevels(in LogLevels levels) 00235 raises (IllegalLogLevelsEx); 00236 00243 stringSeq get_logger_names(); 00244 00252 LogLevels get_logLevels(in string logger_name) 00253 raises (LoggerDoesNotExistEx); 00254 00265 void set_logLevels(in string logger_name, in LogLevels levels) 00266 raises (LoggerDoesNotExistEx, IllegalLogLevelsEx); 00267 00279 oneway void refresh_logging_config(); 00280 }; 00281 00285 struct XmlLogRecord{ 00286 // xml string that represents the Log 00287 string xml; 00288 00289 // Log level of the log record 00290 AcsLogLevels::logLevelValue logLevel; 00291 }; 00292 00296 struct LogStatistics{ 00300 unsigned long long receivedLogs; 00301 }; 00302 00303 typedef sequence<XmlLogRecord> XmlLogRecordSeq; 00304 00305 00306 interface AcsLogService : DsLogAdmin::BasicLog 00307 { 00311 void writeRecords(in XmlLogRecordSeq xmlLogRecords); 00312 00318 LogStatistics getStatistics(); 00319 00320 }; 00321 00322 interface ACSLogFactory : DsLogAdmin::BasicLogFactory 00323 { 00324 }; 00325 00326 interface ACSLogStatistics 00327 { 00328 00329 /* 00330 * Struct that represents the logging statistics information. 00331 */ 00332 struct LogStatsInformation 00333 { 00335 string statsId; 00337 string loggerName; 00339 boolean statsStatus; 00341 unsigned long statsPeriodConfiguration; 00343 unsigned long statsGranularityConfiguration; 00344 00345 }; 00347 /*typedef sequence <LogStatsInformation> logStatsInformationSeq;*/ 00348 typedef sequence <LogStatsInformation> logStatsInformationSeq; 00349 00355 ACSLogStatistics::logStatsInformationSeq get_statistics_logger_configuration(); 00356 00363 ACSLogStatistics::LogStatsInformation get_statistics_logger_configuration_byname(in string logger_name) 00364 raises (LoggerDoesNotExistEx); 00365 00370 void set_statistics_logger_configuration_byname(in string logger_name, in ACSLogStatistics::LogStatsInformation statsInformation) 00371 raises (LoggerDoesNotExistEx); 00372 00373 }; 00374 00375 }; 00376 00377 00378 #endif