Re: [RADIATOR] Store 'LogFormat' in varaible
Hello Jan - You could also try this: DefineFormattedGlobalVar LogFormatDefinition [%%Y-%%m-%%dT%%H:%%M:%%S.%%s] [%%O] [%%3] [%%1] %%2 The first % character is used to escape the second one. Let me know if it works - I haven't tested it. regards Hugh On 14/9/2023 22:41, Jan Bělina wrote: In that variant, special formaters are translated at compile time and every line in log looks like this: [2023-09-14T14:37:23.628949] [0] [] [] [2023-09-14T14:37:23.628949] [0] [] [] [2023-09-14T14:37:23.628949] [0] [] [] [2023-09-14T14:37:23.628949] [0] [] [] ... It looks like simple thing, but it is complicated. Fortunately, it's nothing major :-) Regards Jan Belina Dne 14. 09. 23 v 13:19 Hugh Irvine napsal(a): LogFormat %{GlobalVar:LogFormatDefinition} ___ radiator mailing list radiator@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator
Re: [RADIATOR] Store 'LogFormat' in varaible
Hello Jan - H - yes I see. Well, you can always use a single hook defined in a file I suppose. . LogFormatHook file:"%D/yourformat.pl" . regards Hugh On 14/9/2023 22:41, Jan Bělina wrote: In that variant, special formaters are translated at compile time and every line in log looks like this: [2023-09-14T14:37:23.628949] [0] [] [] [2023-09-14T14:37:23.628949] [0] [] [] [2023-09-14T14:37:23.628949] [0] [] [] [2023-09-14T14:37:23.628949] [0] [] [] ... It looks like simple thing, but it is complicated. Fortunately, it's nothing major :-) Regards Jan Belina Dne 14. 09. 23 v 13:19 Hugh Irvine napsal(a): LogFormat %{GlobalVar:LogFormatDefinition} ___ radiator mailing list radiator@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator
Re: [RADIATOR] Store 'LogFormat' in varaible
In that variant, special formaters are translated at compile time and every line in log looks like this: [2023-09-14T14:37:23.628949] [0] [] [] [2023-09-14T14:37:23.628949] [0] [] [] [2023-09-14T14:37:23.628949] [0] [] [] [2023-09-14T14:37:23.628949] [0] [] [] ... It looks like simple thing, but it is complicated. Fortunately, it's nothing major :-) Regards Jan Belina Dne 14. 09. 23 v 13:19 Hugh Irvine napsal(a): LogFormat %{GlobalVar:LogFormatDefinition} smime.p7s Description: Elektronicky podpis S/MIME ___ radiator mailing list radiator@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator
Re: [RADIATOR] Store 'LogFormat' in varaible
Of course that should be: . LogFormat %{GlobalVar:LogFormatDefinition} . On 14/9/2023 20:54, Hugh Irvine wrote: Hello Jan - Try this instead: DefineFormattedGlobalVar LogFormatDefinition [%Y-%m-%dT%H:%M:%S.%s] [%O] [%3] [%1] %2 Then in your LogFile: . LogFormat %{LogFormatDefinition} . 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 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 ? 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 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@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator ___ radiator mailing list radiator@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator
Re: [RADIATOR] Store 'LogFormat' in varaible
Hello Jan - Try this instead: DefineFormattedGlobalVar LogFormatDefinition [%Y-%m-%dT%H:%M:%S.%s] [%O] [%3] [%1] %2 Then in your LogFile: . LogFormat %{LogFormatDefinition} . 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 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 ? 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 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@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator ___ radiator mailing list radiator@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator
Re: [RADIATOR] Store 'LogFormat' in varaible
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 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 ? 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 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@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator smime.p7s Description: Elektronicky podpis S/MIME ___ radiator mailing list radiator@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator
Re: [RADIATOR] Store 'LogFormat' in varaible
Hello Jan - LogFormat %{GlobalVar:} But if they all have the same LogFormat, why not use an Identifier and have just one ? 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 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@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator___ radiator mailing list radiator@lists.open.com.au https://lists.open.com.au/mailman/listinfo/radiator