Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - slog2_parse_dynamic_buffer API is not working: (17 Items)
   
slog2_parse_dynamic_buffer API is not working  
Hi , I am using below code and using the slog2_parse_dynamic_buffer() API but i am getting error undefined reference for
 slog2_parse_dynamic_buffer(). I have included the corresponding header file and libs in the project but no luck. In the
 same code flow slog2_parse_static_buffer() API working fine. Any solutions.? 

char log_path[PATH_MAX] = "/dev/shmem/slogger2/console.5/";
slog2_log_t my_log;
slog2_log_info_t log_info = SLOG2_LOG_INFO_INIT;
int buffer_index = 0;
slog2_packet_info_t packet_info = SLOG2_PACKET_INFO_INIT;
slog2_buffer_info_t buffer_info = SLOG2_BUFFER_INFO_INIT;

int ret_code = slog2_parse_dynamic_buffer(my_log, buffer_index, &packet_info, my_callback, NULL);
Re: slog2_parse_dynamic_buffer API is not working  
Which libraries are you linking against? The main slog2 functions are in libslog2, but the parsing functions are in 
libslog2parse.
Re: slog2_parse_dynamic_buffer API is not working  
I am linking slog2parse lib.
Re: slog2_parse_dynamic_buffer API is not working  
You're right: it isn't in that library. I've sent an email to the developer.
Re: slog2_parse_dynamic_buffer API is not working  
I also found just now using nm and there is no symbol for slog2_parse_dynamic_buffer api. Is any alternative ways to 
parse continuously.?
Re: slog2_parse_dynamic_buffer API is not working  
The developer is going to reinstate this function. For now, I think you have to use slog2_parse_static_buffer() instead.

Re: slog2_parse_dynamic_buffer API is not working  
ok Thanks. Are we able to parse the buffer continuously with static buffer API .?
Re: slog2_parse_dynamic_buffer API is not working  
Here's what the developer said:

Each time the static buffer API is called it will take a snapshot and print out the logs, a pseudo dynamic print out 
could be achieved by calling it over and over again.

The another method to consider is to use slog2_parse_all() with the SLOG2_PARSE_FLAGS_DYNAMIC flag set, and the 
respective buffer set base name specified in the match_list.

e.g. slog2_parse_all( SLOG2_PARSE_FLAGS_DYNAMIC, NULL, "console", ..., ..., ... )
Re: slog2_parse_dynamic_buffer API is not working  
Ok got it. Thank you Steve for your help.
Re: slog2_parse_dynamic_buffer API is not working  
You're welcome--thanks for helping us discover that the function is missing from the library.
Re: slog2_parse_dynamic_buffer API is not working  
Hi Steve,
I used the slog2_parse_all(
    SLOG2_PARSE_FLAGS_DYNAMIC , NULL,
    "console", &_packet_info, logs_callback, NULL);
API but its not working for console buffer but its working for other buffers. It seems another bug. can you check.?
Re: slog2_parse_dynamic_buffer API is not working  
Here's the developer's response:

I tried this out locally and there is no issue, it should work.

Things to confirm:
1. accessing the console buffer requires root permissions 2. console buffer might be empty; a quick way to append a log 
line: echo "Hello World" > /dev/console 3. does slog2info show the contents of the console buffer?
Re: slog2_parse_dynamic_buffer API is not working  
I am talking about console.5 buffer under /dev/shmem/slogger2 path.
My requirement is collecting the syslog API logs hence I made the changes in /etc/syslog.conf file as *.*    /dev/
console so that all the syslog API logs routed to slog2buffer which is console.5 buffer. Then trying to parse the 
console.5 dynamically to collect the syslog API logs. Please let me know is any other alternatives for my requirement. I
 answered below questions. 

1. accessing the console buffer requires root permissions?
You mean my Application run as root .? how to get the root permissions.?

2. console buffer might be empty; a quick way to append a log 
line: echo "Hello World" > /dev/console.
I have tried but not working.

3. does slog2info show the contents of the console buffer?
No. Even slog2info not able to parse the /dev/shmem/sloger2/console.5 buffer.
Re: slog2_parse_dynamic_buffer API is not working  
Hi Steve, 
Any updates here, please help.
Re: slog2_parse_dynamic_buffer API is not working  
Sorry--things have been busy lately. Have you tried running your application as root?
Re: slog2_parse_dynamic_buffer API is not working  
Yes, Steve, My process is running as root, still not able to access the console buffer dynamically.
Re: slog2_parse_dynamic_buffer API is not working  
Sorry, but I don't think there's anything else I can do to help you with this. It might be time for you to contact Tech 
Support.