# logFile

> Specifies the file to use when writing profiling data.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine.Profiling](/engine/6000.7/script-reference/unityengine/profiling.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static string logFile { get; set; }
```

### Remarks

In addition to specifying a valid file path, you must set both [Profiler.enabled](/engine/6000.7/script-reference/unityengine/profiling/profiler/enabled.md) and [Profiler.enableBinaryLog](/engine/6000.7/script-reference/unityengine/profiling/profiler/enablebinarylog.md) to `true` in order to save profiling information. Specifying a new valid file path while [Profiler.enableBinaryLog](/engine/6000.7/script-reference/unityengine/profiling/profiler/enablebinarylog.md) is `true` will save profiling information to that file instead. If a `null` or an empty path is passed [Profiler.enableBinaryLog](/engine/6000.7/script-reference/unityengine/profiling/profiler/enablebinarylog.md) will automatically be set to `false`.

When using the relative log file path, the directory on each platform is set to [Application.dataPath](/engine/6000.7/script-reference/unityengine/application/datapath.md), apart from WebGL, which uses [Application.persistentDataPath](/engine/6000.7/script-reference/unityengine/application/persistentdatapath.md).

If the buffer is too small to output the profiler data you will see a message in the debug log "Skipping profile frame. Receiver can not keep up with the amount of data sent". Use [Profiler.maxUsedMemory](/engine/6000.7/script-reference/unityengine/profiling/profiler/maxusedmemory.md) to raise the buffer memory.

### Examples

```csharp
using UnityEngine;
using System.Collections;
using UnityEngine.Profiling;

public class ExampleClass : MonoBehaviour
{
    void Start()
    {
        Profiler.logFile = "mylog"; //Also supports passing "myLog.raw"
        Profiler.enableBinaryLog = true;
        Profiler.enabled = true;

        // Optional, if more memory is needed for the buffer
        Profiler.maxUsedMemory = 256 * 1024 * 1024;

        // ...

        // Optional, to close the file when done
        Profiler.enabled = false;
        Profiler.logFile = "";

        // To start writing to a new log file
        Profiler.logFile = "myOtherLog";
        Profiler.enabled = true;
        // ...
    }
}
```
