Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change log level of application not work #379

Closed
SBKK opened this issue May 21, 2022 · 4 comments
Closed

change log level of application not work #379

SBKK opened this issue May 21, 2022 · 4 comments

Comments

@SBKK
Copy link

SBKK commented May 21, 2022

i am using dlt-control to change some app log level

i have
a app registed as "P1" with 1 context
and a app registered as "S1" with 3 context

i want S1's 3 context to switch to log_level 2

dlt-control -a S1 -l 2 localhost
this not work :
apid : P1 ctid: xxx0
apid : S1 ctid: xxx1
apid : S1 ctid: xxx2
apid : S1 ctid: xxx3

if i change "S1" to "O1", this work :
dlt-control -a O1 -l 2 localhost
apid : O1 ctid: xxx1
apid : O1 ctid: xxx2
apid : O1 ctid: xxx3
apid : P1 ctid: xxx0

in the code src/daemon/dlt_daemon_client.c: dlt_daemon_find_multiple_context_and_send_log_level

looks like with app_flag == 1, if not match, it just break ?
since the contexts are sorted,so S > P not work, and O < P work

@thanhbnq
Copy link
Collaborator

thanhbnq commented Sep 6, 2022

Hello @SBKK ,
Sorry for being very late in response.
I tried to reproduce with some small modifications on our test binaries: dlt-example-user and dlt-test-multi-process
There is no issue can be observed as your description.

$ dlt-control -j -u
Get log info:
APID:P1-- Test Application for Logging
CTID:0000 -1 -1 Test Context for Logging
APID:S1-- Apps S1.
CTID:0001 -1 -1 Child 0001 in dlt-test-multi-process
CTID:0002 -1 -1 Child 0002 in dlt-test-multi-process
CTID:0003 -1 -1 Child 0003 in dlt-test-multi-process

$ dlt-control -a S1 -l 2 localhost
[41175.408703]~DLT~27986~INFO     ~dlt_client_send_ctrl_msg: Control message forwarded : DLT_SERVICE_ID_SET_LOG_LEVEL

$ dlt-control -j -u
Get log info:
APID:P1-- Test Application for Logging
CTID:0000 -1 -1 Test Context for Logging
APID:S1-- Apps S1.
CTID:0001  2 -1 Child 0001 in dlt-test-multi-process
CTID:0002  2 -1 Child 0002 in dlt-test-multi-process
CTID:0003  2 -1 Child 0003 in dlt-test-multi-process

$ dlt-control -j -u
Get log info:
APID:P1-- Test Application for Logging
CTID:0000 -1 -1 Test Context for Logging
APID:S1-- Apps S1.
CTID:0001 -1 -1 Child 0001 in dlt-test-multi-process
CTID:0002 -1 -1 Child 0002 in dlt-test-multi-process
CTID:0003 -1 -1 Child 0003 in dlt-test-multi-process

$ dlt-control -a S1 -l 2 localhost
[41906.186320]~DLT~30094~INFO     ~dlt_client_send_ctrl_msg: Control message forwarded : DLT_SERVICE_ID_SET_LOG_LEVEL

$ dlt-control -j localhost
Get log info:
[42035.766102]~DLT~30115~INFO     ~dlt_client_send_ctrl_msg: Control message forwarded : DLT_SERVICE_ID_GET_LOG_INFO
APID:P1-- Test Application for Logging
CTID:0000 -1 -1 Test Context for Logging
APID:S1-- Apps S1.
CTID:0001  2 -1 Child 0001 in dlt-test-multi-process
CTID:0002  2 -1 Child 0002 in dlt-test-multi-process
CTID:0003  2 -1 Child 0003 in dlt-test-multi-process

Can you please enable log of dlt-daemon, reproduce and share with me (dlt.log file)?
How to enable dlt-daemon log (via dlt.conf file)

  • LoggingMode =2
  • LoggingLevel = 7
  • LoggingFilename = /tmp/dlt.log

Thank you,
Thanh

@thanhbnq
Copy link
Collaborator

thanhbnq commented Sep 9, 2022

Hello @SBKK ,
Update:
We are now able to reproduce the issue. We are working on the fix and will raise PR soon.
Regards,
Thanh

@lti9hc
Copy link
Collaborator

lti9hc commented Sep 22, 2022

Hello @SBKK ,
I have created pull request #408 for this issue
I have tested in my side, it works well,
Please kindly test in your side
Thank you,
Tin

@thanhbnq
Copy link
Collaborator

Hello @SBKK ,
#408 is merged and I believe it can help to solve your reported issue.
Hence I'd like to close this.
Please raise new one in case you find something unexpected.
Thank you,
Thanh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants