Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
SAdlam
Contributor
Contributor

Context variable name in logs/stats

Hi,

So i'm loading my context variables via a db and contextload and determining which environment this should be run under in the SQL table. (with a simple active flag),

is there a way i can populate the context environment name from this load, so that my logs and stats don't say "default" in them but reflect the value in the sql table?

Thanks 🙂

Steve

Labels (4)
1 Solution

Accepted Solutions
gjeremy1617088143

there is a String variable named contextStr wich is public , it contain the context type (for my job dev, preprod or prod).

you can play with it in a tJava : contextStr = "the value from the db";

and in all the log the field context will have the value you set.

 

View solution in original post

5 Replies
gjeremy1617088143

Hi do you use tlogcatcher to catch all log ?

In tlogCatcher you have a field context : it's the context state use by the job, you can esaily manipulate this variable with custom value for your log.

SAdlam
Contributor
Contributor
Author

that sounds right. I'm using the inbuilt db function (in job properties) to capture the stats/logs/meter, but still using a tlogcatcher to send some emails.

 

it's the db part i'd like to add this field to. do i need to populate a variable for it?

 

gjeremy1617088143

there is a String variable named contextStr wich is public , it contain the context type (for my job dev, preprod or prod).

you can play with it in a tJava : contextStr = "the value from the db";

and in all the log the field context will have the value you set.

 

SAdlam
Contributor
Contributor
Author

That's fantastic Thankyou! just couldn't find where that variable was!

 

it all works!! 🙂

is there a reference guide with them in somewhere?

gjeremy1617088143

nope I just find it in the code .

select one of my answer as the best please