Please share easy way to create log file file in specific folder

I want to create logs in log folder but i have created already but there is problem is that editing same log file its not creating new log file

@Suraj_Gaikwad_Nuvama_Grou
please check this thread.

@Suraj_Gaikwad_Nuvama_Grou
Additionally:

  1. Check the file path: Verify that the file path you are using to create the log files is correct. Ensure that the folder exists and that you have the necessary write permissions to create files in that location.
  2. Check the file name: Make sure that you are using a unique file name for each log file. If you use the same file name each time, the new log entries might overwrite the existing ones in the same file. You can include a timestamp or a unique identifier in the file name to ensure uniqueness.
  3. Check the file mode: Ensure that you are using the correct file mode when creating the log files. For example, if you are using the “Append” mode, it will append new log entries to the existing file. If you want to create a new log file each time, use the “Create” mode instead.
  4. Add error handling: Implement error handling in your workflow to capture any exceptions that occur during the log file creation process. This way, you can identify any specific errors or exceptions that are preventing the creation of new log files.
  5. Test with a different folder: If the above steps don’t resolve the issue, try creating log files in a different folder or directory to see if the problem persists. This can help identify if the issue is specific to the folder you were previously using.

@Suraj_Gaikwad_Nuvama_Grou

Use a append csv activity to append new logs

So that any log that you add will not over write the previous logs

Cheers

Hi @Suraj_Gaikwad_Nuvama_Grou

By creating logs in log folder I’m assuming that you’re doing that in the VM where bot is running.

Possibly you can create a new Log file each time the bot runs, by appending a datetimestamp to it.
When the bot starts
declare a variable logFilePath=“somePath\Logs\LogFileProcessName”+Now.ToString(“ddMMyyyyhhmmss”)+“.txt”

use this logFilePath at everyplace where you are appending data to your log file.

Thanks

Happy Automation! :smiley:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.