Disable log writes by unity and mono,Disable unity and mono logging in appdata
Asked Answered
W

3

0

Version : unity version 5
OS : Windows 7

My issue is with both unity and mono, they keep registering log data to my appdata folder.

unity is writing an “Editor.log” under unity folder and mono is writing to monodevelop-unity.
while using TRIM command,

The problem : i am behind an SSD where windows appdata folder is located and i would like to put a stop to those logs, how do i do that?

Thanks in advance.

Whitewall answered 30/1, 2024 at 14:22 Comment(0)
R
0

Disabling logging completely is not recommended as it could hinder your ability to debug and track issues within your project. However, if you still wish to disable logging, you can do the following:

For Unity:

You can’t completely disable Unity logging, but you can control the level of logging. In the Unity editor, go to EditPreferences, and in the Preferences window, select General. Under the Log Playback section, set the Editor Log Level to Error Only. This will reduce the amount of logging but still log critical errors.

For Mono:

Disabling logging for MonoDevelop-Unity might not be possible directly within the application. A workaround could be to create a script to automatically clear the log files periodically.

  • Create a new text file and rename it to something like clear_logs.bat.
  • Open the file in a text editor and paste the following code:
@echo off
del /Q /F "%LOCALAPPDATA%\Unity\Editor\Editor.log"
del /Q /F "%LOCALAPPDATA%\MonoDevelop-Unity\*.*"
  • Save the file and run the script whenever you want to clear the logs.

Remember that by disabling or clearing logs, you might lose valuable information that can help you diagnose and fix issues in your project.

Rhododendron answered 30/1, 2024 at 14:23 Comment(0)
W
0

as far as not having errors logged, i will risk it, its better than not having my drive operational.


For Mono: Disabling logging for
MonoDevelop-Unity might not be
possible directly within the
application. A workaround could be to
create a script to automatically clear
the log files periodically.

Create a new text file and rename it to something like clear_logs.bat.

Open the file in a text editor and paste the following code:

God forbid deleting the logs, are you serious?

I don’t want any write commands on my SSD, so you suggest adding another write command? (Which is deleting, in case you don’t know, when you delete something, you mark that area in your filesystem to be re-written later on , so deleting is another write operation that can add to SSD tearing).

Anyone else got more workarounds for me?


EDIT : BUG FOUND - when disabling write permission to unity at %appdata"/unity, when attempting to start unity 5, the program crashes.


This should not be the case , a program shouldn’t crash because it failed to create / modify a log file, it should report an error and do a clean exit, If this error still exist in newer versions of unity, please fix, Thanks in advance.

Whitewall answered 29/4, 2023 at 12:36 Comment(1)

WEBGL Without Custom Template: After building, go to "build" folder. Open "index.html," find </body> and after it Paste: <script> console.log = function() {}; console.warn = function() {}; console.error = function() {}; </script> Save. Refresh already opened page (localhost which had opened after the build was done) in browser ; console is disabled. WEBGL Using Custom Template: Open "index.html" inside webgl template folder that you are using. Find </body>, paste script. Save. Build the application; console is disabled.

Glaudia
G
0

WEBGL Without Custom Template:

  1. After building, go to “build” folder.
  2. Open index.html
  3. Find </body> and after it paste:
<script> console.log = function() {}; console.warn = function() {}; console.error = function() {}; </script>
  1. Save.

  2. Refresh already opened page (localhost which had opened after the build was done) in browser ; console is disabled.

WEBGL Using Custom Template:

  1. Open “index.html” inside webgl template folder that you are using. Find , paste script. Save.
  2. Build the application; console is disabled.
Glaudia answered 30/1, 2024 at 14:17 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.