OK, closing. A new PR can be created with other changes.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3902#issuecomment-2376050039
You are receiving this because you are subscribed to this thread.
Message ID:
Closed #3902.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3902#event-14410454366
You are receiving this because you are subscribed to this thread.
Message ID: ___
Kamailio (SER) - Development Mailing
> With this PR, I understood you actually want to replace the default
> _ksr_slog_func(...)
That is right.
> so I added the option to be able to set the _ksr_slog_func.
Thanks!
I'll try to submit another PR with improvements to the `LOG_XX` macro as
mentioned above for a uniform logging entr
You can call `_ksr_slog_func(...)` function directly, with the `ksr_logdata_t`
structure filled as you want.
With this PR, I understood you actually want to replace the default
`_ksr_slog_func(...)` with your own implementation from a module, so I added
the option to be able to set the `_ksr_sl
> Source file and line number are part of the structure passed to the
> slog-function:
I understand, my question was about the possibility of adding a flavour of the
`LOG_XX` macro that takes file/line as arguments and populates the slog
structure rather than always using `__FILE__`/`__LINE__`.
Source file and line number are part of the structure passed to the
slog-function:
- https://github.com/kamailio/kamailio/blob/master/src/core/dprint.h#L348-L349
You can ignore the other fields if you don't need the corresponding attributes.
--
Reply to this email directly or view it on GitH
@miconda thanks for looking into this! Indeed it seems that structured logging
takes care of most of our needs. But I'm not sure whether it would allow us to
do uniform logging from config files. Let me explain: right now we're using
custom log function from the PR and we're "manually" resolving
I got a bit of the time to look deeper at it and seems to be a mechanism
similar to structured logging, which is already used for JSON logging engine.
See:
- https://github.com/kamailio/kamailio/blob/master/src/core/dprint.h#L338-L353
I added a function to be able to set custom slog callback
I will look into it in more details soon, summer holidays kept me out of the
office quite a lot. It would be good to find a way to have a single framework
that works for all logging related modules, like `log_custom` or `log_systemd`
(maybe these modules can be adapted to the way proposed by thi
> Does it affect in any way the modules log_custom or log_systemd?
Hi @miconda , did the above answer provide sufficient details for you?
> it seems rather important change considering that logging is critical
> component
Perhaps you would us to make any additional changes to further isolate th
This PR is stale because it has been open 6 weeks with no activity. Remove
stale label or comment or this will be closed in 2 weeks.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3902#issuecomment-2319752277
You are receiving this because you are
> Does it affect in any way the modules log_custom or log_systemd?
It does not. Mentioned modules rely on the `_km_log_func` (set via
`km_log_func_set`) while this patch uses `_km_custom_log_func` (set via
`km_custom_log_func_set`) and makes no changes to the `_km_log_func`. The only
downside
I had no time for a proper review, it seems rather important change considering
that logging is critical component. Does it affect in any way the modules
`log_custom` or `log_systemd`?
Maybe other can review as well and make remarks on this change.
--
Reply to this email directly or view it o
Hi @miconda, is there anything else that needs clarifying?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3902#issuecomment-361751
You are receiving this because you are subscribed to this thread.
Message ID: _
Hi @miconda ,
thanks for your feedback!
Regarding `ksr_logdata_t`, most likely it got flagged by some static checker,
but we've re-tested the original version and couldn't pin-point which exact
check/rule triggered this.
Regarding the `asprintf` - thanks for spotting the memory leak! We've ne
> Any reason that:
>
> ```
> ksr_logdata_t __kld = {0};
> ```
>
> I replaced with:
>
> ```
> ksr_logdata_t __kld = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
> ```
I've reverted the change.
> Also, `asprintf()` allocates memory, it is freed somewhere?
It is now, at the end of the function.
--
Reply
@anmartan pushed 1 commit.
2ecd44410be96c441f137a0c02ffe47a51f20fd9 --amend
--
View it on GitHub:
https://github.com/kamailio/kamailio/pull/3902/files/52277d9b74e6ba2973ecaa0163a49be54bdd5454..2ecd44410be96c441f137a0c02ffe47a51f20fd9
You are receiving this because you are subscribed to this thr
Any reason that:
```
ksr_logdata_t __kld = {0};
```
I replaced with:
```
ksr_logdata_t __kld = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
```
Also, `asprintf()` allocates memory, it is freed somewhere?
Then, when this new mechanism is used and what is the benefit? Can you provide
some examples?
--
Re
@anmartan pushed 1 commit.
52277d9b74e6ba2973ecaa0163a49be54bdd5454 core: add support for custom log
function
--
View it on GitHub:
https://github.com/kamailio/kamailio/pull/3902/files/411b3c9fa3157437a0973cf66ee47fc6096b4e21..52277d9b74e6ba2973ecaa0163a49be54bdd5454
You are receiving this bec
19 matches
Mail list logo