---
title: "Logging a Session"
canonical: "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/InputOutput/logging.html"
source: "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/InputOutput/logging.md"
part: "The Magma Language"
chapter: "Input and Output"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "The Magma Language", "source": "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/index-magma-language.md"}
  - {"title": "Input and Output", "source": "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/InputOutput/index-input-output.md"}
prev: {"title": "Saving and Restoring Workspaces", "source": "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/InputOutput/workspace.md"}
next: {"title": "Memory Usage", "source": "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/InputOutput/system-calls.md"}
intrinsics:
  - {"name": "SetLogFile", "signature": "SetLogFile(F): MonStgElt"}
  - {"name": "UnsetLogFile", "signature": "UnsetLogFile()"}
  - {"name": "SetEchoInput", "signature": "SetEchoInput(b): BoolElt"}
---

# Logging a Session

<a id="procedure-setlogfile-monstgelt"></a>
## `SetLogFile(F): MonStgElt`

```magma
Overwrite: BoolElt                    Default: false
```

Set the log file to be the file specified by the string $F$: all input and output will be sent to this log file as well as to the terminal. If a log file is already in use, it is closed and $F$ is used instead. By using `SetLogFile(F: Overwrite := true)` the file $F$ is emptied before input and output are written onto it. See also `HasOutputFile`.

<a id="procedure-unsetlogfile"></a>
## `UnsetLogFile()`

Stop logging Magma’s output.

<a id="procedure-setechoinput-boolelt"></a>
## `SetEchoInput(b): BoolElt`

Send input from external files to standard output if $b$ is `true`. If $b$ is `false` then input from external files will not appear in standard output.
