How to customize the name of log file which is generated when using log message activity

studio
logs

#1

Hi everyone,

How I can customize the name of log file which is generated when using log message activity.
I want to something like this: yyyyMMdd HH.

Please help me.

Many thanks,
Hoang Anh.


#2

Hi,

Have a look on this activity.

You could add a log field with a specific name, if you want this specific format, i do it with the datatype string and passing value Now.toString(“yyyyMMdd HH”), Datetime will have different formating.

Cheers


#3

Hi @Florent_Salendres,

I mean i want to change the name of log file at folder: C:\Users\PC\AppData\Local\UiPath\Logs.
currently its name is something like this; 2017-11-13_Execution.log
and i want to change it to: yyyyMMdd_HH.log.

Thanks
Hoang Anh.


#4

Oops,

One UIPath instalation you have Nlog.config file.

In there you should be able to modify the fileName pattern and its location if you want.

you have here explaination on how you can customize it

I think you need to modfiy “Excecution file one”

Cheers


#5

Hi @Florent_Salendres,

I found the Nlog.Config file at: C:\Program Files (x86)\UiPath Platform.
And the file name of log file has format as follow: {LogDirectory}/{shortdate}_Execution.log"
Could you show me how to change this value to: yyyyMMdd HH.log

Many thanks,
Hoang Anh.


#6

Hi @anhth15,

Try to use: fileName="{LogDirectory}/{date:format=yyyyMMdd HH}.log"

image

Regards,
Susana


#7

Thank @Susana,
It worked for my case.