> For the complete documentation index, see [llms.txt](https://avbravo-2.gitbook.io/payaramicro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://avbravo-2.gitbook.io/payaramicro/chapter1/archivo-log.md).

# Archivo log

para crear un log

<https://payara.gitbooks.io/payara-server/documentation/payara-micro/logging-to-file.html>

Usar

```
--logToFile /home/user/PayaraMicro.log
```

Ejemplo

```
java -jar payara-micro.jar --logToFile /home/user/PayaraMicro.log
```

## Logging to a file Programmatically <a href="#logging-to-a-file-programmatically" id="logging-to-a-file-programmatically"></a>

```java
import fish.payara.micro.PayaraMicro;
import fish.payara.micro.BootstrapException;

public class EmbeddedPayara
{
    public static void main(String[] args) throws BootstrapException
    {
         PayaraMicro.getInstance().setUserLogFile("/home/user/PayaraMicro.log").bootStrap();
    }
}
```
