hefestoapicontainer

Logs

La directiva Log registra cada petición y cada job en un fichero rotado diariamente dentro del hefesto-pathstorage de la API.

Por defecto, al crear una API desde el cliente, Log se incluye automáticamente en el after con grupo AFTER_FLOW:

after:
  Log:
    directive: Log
    groups:
      - AFTER_FLOW

Esto significa que Log se ejecuta después de enviar la respuesta al cliente, sin afectar la latencia de la petición.

Los logs se almacenan en ficheros con el nombre hefesto-YYYY-MM-DD.log. Cada línea es un JSON con toda la información de la request y la response:

Ejemplo de una línea de log de una request:

[
   {
      "id":"6g44hcfd52d1i9.95189580",
      "type":"REQUEST",
      "timestamp":"2026-06-23 22:25:17",
      "verb":"POST",
      "path":"\/job\/body",
      "headers":{
         "CONTENT-LENGTH":"0",
         "CONNECTION":"keep-alive",
         "ACCEPT-ENCODING":"gzip, deflate, br",
         "ACCEPT":"*\/*",
         "HOST":"localhost"
      },
      "realVerb":"POST",
      "realPath":"\/job\/body",
      "queryParams":[
         
      ],
      "body":""
   },
   {
      "id":"6g44hcfd52d1i9.95189580",
      "duration":2,
      "type":"RESPONSE",
      "status":200,
      "headers":{
         "CONTENT-TYPE":"application\/json",
         "CONTENT-LENGTH":"51"
      },
      "body":"{\"message\":\"queued\",\"id\":\"6g44hcfd52d1i9.95189580\"}",
      "correlationId":"6a44dcfd4jfh6.04307201"
   }
]

Para los jobs, el type inicial cambia a INIT_JOB en lugar de REQUEST, y el final a FINISH_JOB en lugar de RESPONSE. En caso de error, tanto en los jobs como en las peticiones http, aparecerá un objeto intermedio con el mensaje de la excepción que se lanzó, y la directiva en que tuvo lugar el error.

[
   {
      "id":"642758bcc14aa1.854ghdfs",
      "type":"REQUEST",
      "timestamp":"2026-06-29 23:36:28",
      "verb":"GET",
      "path":"\/directives",
      "headers":{
         "ACCEPT-LANGUAGE":"es-ES,es;q=0.9,en-US;q=0.8,en;q=0.7",
         "ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8",
      },
      "realVerb":"GET",
      "realPath":"\/directives",
      "queryParams":[
         
      ],
      "body":""
   },
   {
      "id":"642758bcc14aa1.854ghdfs",
      "directive":"App\\Apis\\release6a4255114f29f\\Directives\\View",
      "order":3,
      "error":"syntax error, unexpected token \"<\", expecting end of file (View: \/var\/www\/app\/Apis\/release6a4255114f29f\/Assets\/views\/directives.blade.php)"
   },
   {
      "id":"642758bcc14aa1.854ghdfs",
      "duration":1,
      "type":"RESPONSE",
      "status":500,
      "headers":{
         "CONNECTION":"keep-alive",
         "ACCEPT-ENCODING":"gzip, deflate, br, zstd",
         "ACCEPT":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8",
         "CONTENT-LENGTH":"33",
         "CACHE-CONTROL":"no-cache",
         "CONTENT-TYPE":"application\/json"
      },
      "body":"{\"error\":\"Internal Server Error\"}",
      "correlationId":"6a4258bcc16303.83083789"
   }
]