Hi Team,
I am using Message logging policy. I would like to pass value to host parameter dynamically. Is ther any possible way to set value dynamically?
We have different environment under one organization, would like to dynamically set different host to message logging policy host based on environment.
Have read the documentation, it mentioned like below.
Host
andPort
elements cannot refer to variables. They must contain static
values.
Please let me know if there is any possible best approach for my requirement.
Thanks,
Satheesh
Solved! Go to Solution.
Hi Satheesh,
Right, you cannot use reference variables in Message Logging policy.
Usually, even if you have multiple environments, there is a centralized log aggregator which collects logs from all envs. This is usually accomplished by adding the env as a field in your Message Log.
If you have to send logs to different log servers, then I think you will have to use separate MessageLogging policy for each region and conditinally enforce them - something like this
<Step> <Condition>system.region.name="test"</Condition> <Name>WriteSyslogToTest</Name> </Step> <Step> <Condition>system.region.name="test"</Condition> <Name>WriteSyslogToProd</Name> </Step>
Thanks,
Hi Satheesh,
Right, you cannot use reference variables in Message Logging policy.
Usually, even if you have multiple environments, there is a centralized log aggregator which collects logs from all envs. This is usually accomplished by adding the env as a field in your Message Log.
If you have to send logs to different log servers, then I think you will have to use separate MessageLogging policy for each region and conditinally enforce them - something like this
<Step> <Condition>system.region.name="test"</Condition> <Name>WriteSyslogToTest</Name> </Step> <Step> <Condition>system.region.name="test"</Condition> <Name>WriteSyslogToProd</Name> </Step>
Thanks,
Thanks for your suggestion, it works fine.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |