Chris Liang(deleted)
|
slogger writes non-sense messages to the log file
|
Chris Liang(deleted)
01/07/2019 10:55 AM
post119389
|
slogger writes non-sense messages to the log file
Hi,
I am using slogger to write debugging message to a /var/log/message.
execute the command 'slogger -s 2048k -l -l /var/logs/message -f 5' at the early system up stage.
However, when I looked at the logged messages from sloginfo -t -w.
it contains very non-sense messages which human cannot understand.
ie.
GOOD LOGS:
Nov 30 23:07:24.501 5 10000 0 <compute.cpp:285> static lever arm v, 0.008, -0.133, 0.070, 0.000, 0.000, 0.000, 0.
008, -0.133, 0.070
BAD LOGS: the month is changed to Aug for some reason....
Aug 23 15:49:06.663 3 93795 1862 1635149164 1701064291 1886403122 859061792 538976288 538979360 1936619103
1915642992 1529961768 825112113 875113504 1936619103 1915647579 828188720 774910008 690757740 1634956383 1985687901
674246192 808986924 543454258 674246192 808659244 541339944 824788018 674244896 1936619103 1915647016 909192752
926099756 544435830 1600416115 1949201448 909192752 926099756 544497513 1953900592 774910005 807993392 2826093 10000
1543619244 1013213555 1952542307 1700754546 1635149164 1701064291 1886403122 859061792 538976288 538979360 1936619103
1915642992 1530027304 758328886 909453612 544435830 1601318518 1530027304 758132273 858990892
I thought it might be the sloginfo utility issue. Then, I wrote a stand along utility to decode slogger message by open
/dev/slog
Now the bad logs is not numbers but it is still not making any senses
GOOD LOGS:
Jan 06 20:43:13.528 5 10000 0: <compute.cpp:231> -77.586, 5.348, 45.341, -0.005, -0.000, 0.003, 162802.148
BAD LOGS:
Sep 18 07:27:48.757 7 290669 1782: a.valid to false, (162806.585, 74597.004), head from (2) advanced to (0)
Feb 01 05:31:12.838 7 536617 514:
Jan 01 02:46:40.758 5 133901 1: \2hf<compute.cpp:386> numOfMsgFromIin = 162759
Sep 18 07:27:48.757 7 290669 1782: a.valid to false, (162807.585, 74598.004), head from (0) advanced to (1)
I think it might be related to slogger utility.
Any one knows the issues?
Thanks in advance...
|
|
|
Chris Liang(deleted)
|
Re: slogger writes non-sense messages to the log file
|
Chris Liang(deleted)
01/08/2019 10:08 AM
post119394
|
Re: slogger writes non-sense messages to the log file
Did I post in right place? If not, please guide me where I should post it
Many thanks
|
|
|
Chris Liang(deleted)
|
Re: slogger writes non-sense messages to the log file
|
Chris Liang(deleted)
01/09/2019 11:06 AM
post119398
|
Re: slogger writes non-sense messages to the log file
Please, any one knows?
> Hi,
> I am using slogger to write debugging message to a /var/log/message.
>
> execute the command 'slogger -s 2048k -l -l /var/logs/message -f 5' at the
> early system up stage.
>
> However, when I looked at the logged messages from sloginfo -t -w.
>
> it contains very non-sense messages which human cannot understand.
> ie.
>
> GOOD LOGS:
> Nov 30 23:07:24.501 5 10000 0 <compute.cpp:285> static lever arm v, 0.008, -0.133, 0.070
> , 0.000, 0.000, 0.000, 0.008, -0.133, 0.070
>
> BAD LOGS: the month is changed to Aug for some reason....
> Aug 23 15:49:06.663 3 93795 1862 1635149164 1701064291 1886403122
> 859061792 538976288 538979360 1936619103 1915642992 1529961768 825112113
> 875113504 1936619103 1915647579 828188720 774910008 690757740 1634956383
> 1985687901 674246192 808986924 543454258 674246192 808659244 541339944
> 824788018 674244896 1936619103 1915647016 909192752 926099756 544435830
> 1600416115 1949201448 909192752 926099756 544497513 1953900592 774910005
> 807993392 2826093 10000 1543619244 1013213555 1952542307 1700754546 1635149164
> 1701064291 1886403122 859061792 538976288 538979360 1936619103 1915642992
> 1530027304 758328886 909453612 544435830 1601318518 1530027304 758132273
> 858990892
>
> I thought it might be the sloginfo utility issue. Then, I wrote a stand along
> utility to decode slogger message by open /dev/slog
>
> Now the bad logs is not numbers but it is still not making any senses
>
> GOOD LOGS:
> Jan 06 20:43:13.528 5 10000 0: <compute.cpp:231> -77.586, 5.348, 45.341, -0.005, -0.000, 0.
> 003, 162802.148
>
> BAD LOGS:
> Sep 18 07:27:48.757 7 290669 1782: a.valid to false, (162806.585, 74597.004)
> , head from (2) advanced to (0)
> Feb 01 05:31:12.838 7 536617 514:
> Jan 01 02:46:40.758 5 133901 1: \2hf<compute.cpp:386> numOfMsgFromIin = 162759
> Sep 18 07:27:48.757 7 290669 1782: a.valid to false, (162807.585, 74598.004)
> , head from (0) advanced to (1)
>
> I think it might be related to slogger utility.
>
> Any one knows the issues?
>
> Thanks in advance...
|
|
|
Peter Weber
|
Re: slogger writes non-sense messages to the log file
|
Peter Weber
01/09/2019 11:15 AM
post119399
|
Re: slogger writes non-sense messages to the log file
what does the -l -l ...stands for?
|
|
|
Peter Weber
|
Re: slogger writes non-sense messages to the log file
|
Peter Weber
01/09/2019 11:22 AM
post119400
|
Re: slogger writes non-sense messages to the log file
|
|
|
Chris Liang(deleted)
|
Re: slogger writes non-sense messages to the log file
|
Chris Liang(deleted)
01/09/2019 11:35 AM
post119402
|
Re: slogger writes non-sense messages to the log file
Yes,
I used 'sloginfo -t -w' which print messages once they arrived. the default log file is /dev/slog
I also saved to /var/log/message as 'slogger -s 2048k -l /var/logs/message -f 5' -l specify the saved raw log file.
then, 'sloginfo -t /var/log/message' to print out the saved log message.
They all contains some garbage logs.
> and have you tried using sloginfo to read the log file as suggested in the
> docs?
> http://www.qnx.com/developers/docs/6.6.0.update/#com.qnx.doc.neutrino.
> utilities/topic/s/sloginfo.html
|
|
|
Chris Liang(deleted)
|
Re: slogger writes non-sense messages to the log file
|
Chris Liang(deleted)
01/09/2019 11:23 AM
post119401
|
Re: slogger writes non-sense messages to the log file
Sorry, it was a typo.
It is only one '-l'
slogger -s 2048k -l /var/logs/message -f 5
> what does the -l -l ...stands for?
|
|
|
Peter Weber
|
Re: slogger writes non-sense messages to the log file
|
Peter Weber
01/09/2019 11:54 AM
post119403
|
Re: slogger writes non-sense messages to the log file
seems an app is writing binary data using the wrong API. e.g. slogf() instead of slogb() ?
|
|
|
Chris Liang(deleted)
|
Re: slogger writes non-sense messages to the log file
|
Chris Liang(deleted)
01/09/2019 12:07 PM
post119404
|
Re: slogger writes non-sense messages to the log file
Peter,
Thanks for replying..
I am using the slogf API to log the data.
You recommend to use slogb?
slogf is for formatted message. I do format the message.
|
|
|
Peter Weber
|
Re: slogger writes non-sense messages to the log file
|
Peter Weber
01/10/2019 3:55 AM
post119405
|
Re: slogger writes non-sense messages to the log file
Hi Chris,
the only reason I can think of is, when your application is writing binary data into the slogf().
The API for slog maintains a flag, telling the server (slogger) that the data is readably text or just binary data.
So when your Apps are writing binary data using slogf(), this garbage will be in the servers text buffers.
In general, when sending binary (raw) data, you should use the slogb() API, when sending just readable text, use slogf()
. A third API to send just integers as an array which later can be translated when the message is read and interpreted.
Again, I think in your case, one of the formatted message contains no zero termination or garbage. I can't imagine, the
slogger damages the messages on the server side.
Do you have the source of the app, the garbage comes from?
|
|
|
Chris Liang(deleted)
|
Re: slogger writes non-sense messages to the log file
|
Chris Liang(deleted)
01/10/2019 10:51 AM
post119409
|
Re: slogger writes non-sense messages to the log file
Hi Peter,
Thank you again for all the comments and thoughts.
You are right, to send formatted messages, use slogf().
I am sending formatted ascii txt message in my case.
my code is:
sprintf(debugMsg, "%.3f, %.3f", distance, time);
slogf(_SLOG_SETCODE(_SLOGC_TEST, 0), _SLOG_DEBUG1, "<%s:%d> compute :%s", LOG_IDENT(id), __LINE__, debugMsg);
As you can see, this is formatted readable ASCII message. slogf is correct API to use. I am sending exactly same message
repeat all over again. I saw the garbage messages after the program ran for 10 mins. the logging rate is in 200Hz.
I am thinking it might related to the heap memory. Because I ran slogger with 'slogger -s 256k -l /dev/shmem/log -f 7',
-s 256k specify in-memory buffer size used which is allocated on heap. If I increase to -s 15000k, I do not see the
garbage at all.
Thanks.
> Hi Chris,
> the only reason I can think of is, when your application is writing binary
> data into the slogf().
> The API for slog maintains a flag, telling the server (slogger) that the data
> is readably text or just binary data.
> So when your Apps are writing binary data using slogf(), this garbage will be
> in the servers text buffers.
>
> In general, when sending binary (raw) data, you should use the slogb() API,
> when sending just readable text, use slogf(). A third API to send just
> integers as an array which later can be translated when the message is read
> and interpreted.
>
> Again, I think in your case, one of the formatted message contains no zero
> termination or garbage. I can't imagine, the slogger damages the messages on
> the server side.
>
> Do you have the source of the app, the garbage comes from?
|
|
|
Chris Liang(deleted)
|
Re: slogger writes non-sense messages to the log file
|
Chris Liang(deleted)
01/10/2019 10:53 AM
post119410
|
Re: slogger writes non-sense messages to the log file
> Hi Chris,
> the only reason I can think of is, when your application is writing binary
> data into the slogf().
> The API for slog maintains a flag, telling the server (slogger) that the data
> is readably text or just binary data.
> So when your Apps are writing binary data using slogf(), this garbage will be
> in the servers text buffers.
>
> In general, when sending binary (raw) data, you should use the slogb() API,
> when sending just readable text, use slogf(). A third API to send just
> integers as an array which later can be translated when the message is read
> and interpreted.
>
> Again, I think in your case, one of the formatted message contains no zero
> termination or garbage. I can't imagine, the slogger damages the messages on
> the server side.
>
> Do you have the source of the app, the garbage comes from?
Hi Peter,
Thank you again for all the comments and thoughts.
You are right, to send formatted messages, use slogf().
I am sending formatted ascii txt message in my case.
my code is:
sprintf(debugMsg, "%.3f, %.3f", distance, time);
slogf(_SLOG_SETCODE(_SLOGC_TEST, 0), _SLOG_DEBUG1, "<%s:%d> compute :%s", LOG_IDENT(id), __LINE__, debugMsg);
As you can see, this is formatted readable ASCII message. slogf is correct API to use. I am sending exactly same message
repeat all over again. I saw the garbage messages after the program ran for 10 mins. the logging rate is in 200Hz.
I am thinking it might related to the heap memory. Because I ran slogger with 'slogger -s 256k -l /dev/shmem/log -f 7',
-s 256k specify in-memory buffer size used which is allocated on heap. If I increase to -s 15000k, I do not see the
garbage at all.
Thanks.
|
|
|
|