- Description has changed:

Diff:

~~~~

--- old
+++ new
@@ -1,45 +1,23 @@
-Currently, there are 3 concerns related to WARNING messages that should be 
resolved:
+Here are what we expect when the enviroment variable OSAF_LOCAL_NODE_LOG is 
enabled:
 
-- First,  file 
[OpenSAF_Overview_PR](https://sourceforge.net/p/opensaf/documentation/ci/default/tree/OpenSAF_Overview_PR.odt):
 at page 47,  section 3.7.9.1 (Local node log) describes that  all non-error 
logs (NOTICE, DEBUG, INFO) should be logged into local file osaf.log except 
WARNING. In addition, ticket 
[#2306](http://sourceforge.net/p/opensaf/tickets/2306/) described to save all 
logs including ERROR, CRITICAL, ALERT, EMERG into syslog. Therefore the concern 
is where WARNING is logged.
+1) All error messages including ERROR, CRITICAL, ALERT, EMERGENCY will log to 
syslog only
+2) All non-error messages will log to local log file 
(/var/log/opensaf/osaf.log)
 
-- Second, WARNING logs are also logged into syslog:
+In case that enviroment variable is disable, all logs will be written to 
syslog.
+
+However, with current code, it does not work like that: warning and error 
messages are written to both sources when the enviroment variables is enabled.
+
+Here are evidences:
+1) WARNING logs are also logged into syslog:
 > root@SC-1:/var/log# grep " WA " /var/log/syslog 
 > 2018-09-10 14:15:41.313 SC-1 osafimmloadd: WA Could not open 
 > repository:imm.db
 > 2018-09-10 14:15:41.530 SC-1 osafimmnd[207]: WA IMM Access Control mode is 
 > DISABLED!
 > 2018-09-10 14:15:43.198 SC-1 osafckptd[417]: WA saImmOiImplementerSet 
 > returned 9
 
-Our expectation is that ERROR, CRITICAL, ALERT, EMERG should logged into 
syslog not WARNING
-This fault is in file logtrace.cc, fucntion logtrace_log, line 148, code 
checks for logging messages into syslog including WARNING :
 
-~~~
-if (global::enable_osaf_log == false || 
-         (global::enable_osaf_log && priority <= LOG_WARNING))
-~~~
+2) Error logs are also logged into the local file osaf.log
+> root@SC-1:~# grep " ER " /var/log/opensaf/osaf.log
+> <139>1 2018-09-11T17:27:56.489759+07:00 SC-1 osafimmd 196 osaf.log [meta 
sequenceId="4"] 196:imm/immd/immd_main.c:294 ER >>>>>>>>> Test log ERROR where 
to logged
+> <139>1 2018-09-11T17:27:56.584763+07:00 SC-1 osafimmnd 207 osaf.log [meta 
sequenceId="4"] 207:imm/immnd/immnd_main.c:465 ER >>>>>>>>> Test log ERROR 
where ND to logged
 
-- Third, ERROR, CRITICAL, ALERT, EMERGENCY logs are also logged into the local 
file osaf.log: 
-ERROR Logs:
-root@SC-1:~# grep " ER " /var/log/opensaf/osaf.log
-<139>1 2018-09-11T17:27:56.489759+07:00 SC-1 osafimmd 196 osaf.log [meta 
sequenceId="4"] 196:imm/immd/immd_main.c:294 ER >>>>>>>>> Test log ERROR where 
to logged
-<139>1 2018-09-11T17:27:56.584763+07:00 SC-1 osafimmnd 207 osaf.log [meta 
sequenceId="4"] 207:imm/immnd/immnd_main.c:465 ER >>>>>>>>> Test log ERROR 
where ND to logged
-CRITICAL Logs:
-root@SC-1:~# grep " CR " /var/log/opensaf/osaf.log
-<138>1 2018-09-11T17:27:56.489442+07:00 SC-1 osafimmd 196 osaf.log [meta 
sequenceId="3"] 196:imm/immd/immd_main.c:293 CR >>>>>>>>> Test log CRITICAL 
where to logged
-<138>1 2018-09-11T17:27:56.584506+07:00 SC-1 osafimmnd 207 osaf.log [meta 
sequenceId="3"] 207:imm/immnd/immnd_main.c:464 CR >>>>>>>>> Test log CRITICAL 
where ND to logged
-ALERT Logs:
-root@SC-1:~# grep " AL " /var/log/opensaf/osaf.log
-<137>1 2018-09-11T17:27:56.489004+07:00 SC-1 osafimmd 196 osaf.log [meta 
sequenceId="2"] 196:imm/immd/immd_main.c:292 AL >>>>>>>>> Test log ALERT where 
to logged
-<137>1 2018-09-11T17:27:56.584195+07:00 SC-1 osafimmnd 207 osaf.log [meta 
sequenceId="2"] 207:imm/immnd/immnd_main.c:463 AL >>>>>>>>> Test log ALERT 
where ND to logged
-EMERGENCY Logs:
-root@SC-1:~# grep " EM " /var/log/opensaf/osaf.log
-<136>1 2018-09-11T17:27:56.488381+07:00 SC-1 osafimmd 196 osaf.log [meta 
sequenceId="1"] 196:imm/immd/immd_main.c:291 EM >>>>>>>>> Test log EMERGENCY 
where to be logged
-<136>1 2018-09-11T17:27:56.583837+07:00 SC-1 osafimmnd 207 osaf.log [meta 
sequenceId="1"] 207:imm/immnd/immnd_main.c:462 EM >>>>>>>>> Test log EMERGENCY 
ND where to be logged
-
-Our expectation is that non-error logs (WARNING, NOTICE, DEBUG, INFO) are 
logged into the local file osaf.log.
-
-This fault is in line 160, code checks whether flag OSAF_LOCAL_NODE_LOG is set 
or not while it does not check which logs should be written. Therefore, all of 
logs will be logged into the local file osaf.log 
-
-~~~
-if (global::enable_osaf_log == true) {
-    log_output(file, line, priority, CAT_LOG, format, ap2);
- }
-~~~
+Besides, the section "3.7.9.1 Local node log" in [PR 
document](https://sourceforge.net/p/opensaf/documentation/ci/default/tree/OpenSAF_Overview_PR.odt)
 should be updated too.

~~~~




---

** [tickets:#2924] base:  unexpected messages in syslog and the local log file 
osaf.log**

**Status:** accepted
**Milestone:** 5.18.09
**Created:** Fri Sep 07, 2018 10:08 AM UTC by Lê Khánh Linh
**Last Updated:** Tue Sep 11, 2018 11:49 AM UTC
**Owner:** Lê Khánh Linh


Here are what we expect when the enviroment variable OSAF_LOCAL_NODE_LOG is 
enabled:

1) All error messages including ERROR, CRITICAL, ALERT, EMERGENCY will log to 
syslog only
2) All non-error messages will log to local log file (/var/log/opensaf/osaf.log)

In case that enviroment variable is disable, all logs will be written to syslog.

However, with current code, it does not work like that: warning and error 
messages are written to both sources when the enviroment variables is enabled.

Here are evidences:
1) WARNING logs are also logged into syslog:
> root@SC-1:/var/log# grep " WA " /var/log/syslog 
> 2018-09-10 14:15:41.313 SC-1 osafimmloadd: WA Could not open repository:imm.db
> 2018-09-10 14:15:41.530 SC-1 osafimmnd[207]: WA IMM Access Control mode is 
> DISABLED!
> 2018-09-10 14:15:43.198 SC-1 osafckptd[417]: WA saImmOiImplementerSet 
> returned 9


2) Error logs are also logged into the local file osaf.log
> root@SC-1:~# grep " ER " /var/log/opensaf/osaf.log
> <139>1 2018-09-11T17:27:56.489759+07:00 SC-1 osafimmd 196 osaf.log [meta 
> sequenceId="4"] 196:imm/immd/immd_main.c:294 ER >>>>>>>>> Test log ERROR 
> where to logged
> <139>1 2018-09-11T17:27:56.584763+07:00 SC-1 osafimmnd 207 osaf.log [meta 
> sequenceId="4"] 207:imm/immnd/immnd_main.c:465 ER >>>>>>>>> Test log ERROR 
> where ND to logged

Besides, the section "3.7.9.1 Local node log" in [PR 
document](https://sourceforge.net/p/opensaf/documentation/ci/default/tree/OpenSAF_Overview_PR.odt)
 should be updated too.



---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/opensaf/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/opensaf/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to