[RADIATOR] Store 'LogFormat' in varaible

Hugh Irvine hugh at radiatorsoftware.com
Thu Sep 14 10:54:21 UTC 2023


Hello Jan -

Try this instead:

DefineFormattedGlobalVar LogFormatDefinition [%Y-%m-%dT%H:%M:%S.%s] [%O] 
[%3] [%1] %2

Then in your LogFile:

<Log FILE>

     .....

     LogFormat %{LogFormatDefinition}

     .....

</Log>

Please let us know your results.

regards

Hugh


On 14/9/2023 19:11, Jan Bělina wrote:
> I have separate logfiles for 'Trace 3' and 'Trace 4' logs and some 
> other for hooks only, for easy debuging.
>
> Simple solution with %{GlobalVar:....}was first what i tried, but it 
> seams that special formaters is not followed.
>
> For example if i set:
>
> DefineGlobalVar LogFormat [%Y-%m-%dT%H:%M:%S.%s] [%O] [%3] [%1] %2
>
> And use it in <Log FILE> block, then all lines in log is like this:
>
> [%Y-%m-%dT%H:%M:%S.%s] [%O] [%3] [%1] %2
> [%Y-%m-%dT%H:%M:%S.%s] [%O] [%3] [%1] %2
> [%Y-%m-%dT%H:%M:%S.%s] [%O] [%3] [%1] %2
> [%Y-%m-%dT%H:%M:%S.%s] [%O] [%3] [%1] %2
> [%Y-%m-%dT%H:%M:%S.%s] [%O] [%3] [%1] %2
> ...
>
> So, this is not the right way for me :-)
>
> Jan Belina
>
>
> Dne 14. 09. 23 v 10:57 Hugh Irvine napsal(a):
>>
>> Hello Jan -
>>
>>
>> LogFormat %{GlobalVar:....}
>>
>>
>> But if they all have the same LogFormat, why not use an Identifier 
>> and have just one <Log FILE>?
>>
>>
>> regards
>>
>> Hugh
>>
>>
>> On 14/9/2023 18:48, Jan Bělina via radiator wrote:
>>>
>>> Hi all,
>>>
>>> does anyone have an idea, how to store LogFormat in a variable? I 
>>> have many <Log FILE> blocks with the same LogFormat clauses. It 
>>> would be nice to use GlobalVar for it, but i dont know how to do it...
>>>
>>> Best regards,
>>>
>>> Jan Belina
>>>
>>>
>>> _______________________________________________
>>> radiator mailing list
>>> radiator at lists.open.com.au
>>> https://lists.open.com.au/mailman/listinfo/radiator


More information about the radiator mailing list