How can I print out a message in the system log?

med1
Kilo Contributor

Hi all, Im new to ServiceNow I would like some help with:

How can I print out a message in the system log?

The workflow assigned to this catalogue item should print out a log in the system logs to say "User <name of the user> has ordered more <RAM or CPU> for server <server name>". The same message should be written also in the Work Notes field of the Requested Item. Set the

state of the RITM to Closed complete after writing the messages in the previous step.

Many thanks!

 

30 REPLIES 30

Hi,

it should show unless you created that in another scope

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

And how do i what scope i am in ?

Hi,

I would suggest to go through On-Demand Admin course which would give you an idea on most of the components.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Murthy Ch
Giga Sage

Hi med,

You have to use gs.info to print log messages.

 

Var data= 'user'+ current.request.requested_for.name + 'has ordered more' + current.variables.resources + 'for the server' current.variables.var_a;

 

gs.info(data);

 

Thanks,

Thanks,
Murthy

med1
Kilo Contributor

Hi 

 

In what kind of script do I have to put this code?

 

Thank you for your assistant Murthy