Hexoku.API.LogSession

A log session is a reference to the http based log stream for an app.

Attributes

id
unique identifier of item generated by Heroku
logplex_url
URL for log streaming session
created_at
when item was created
updated_at
when item was last modified

For more info read the Heroku API Reference

Source

Summary

create(client, app, payload)

Create a new log session

get(client, app, options \\ %{})

Helper to get application logs as binary

stream(client, app, options \\ %{}, fun)

Helper to stream application logs as binary to a fun

Functions

create(client, app, payload)

Specs:

Create a new log session.

Payload Attributes

dyno
dyno to limit results to
lines
number of log lines to stream at once
source
log source to limit results to
tail
whether to stream ongoing logs

Examples

client |> Hexoku.API.LogSession.create("myapp", %{
    source: "app",
    lines: 50
})
Source
get(client, app, options \\ %{})

Specs:

  • get(Hexoku.Client.t, binary, Map.t) :: binary | :error

Helper to get application logs as binary.

Examples

client |> Hexoku.API.LogSession.get("myapp")
client |> Hexoku.API.LogSession.get("myapp", %{source: "heroku", lines: 10})
Source
stream(client, app, options \\ %{}, fun)

Specs:

  • stream(Hexoku.Client.t, binary, Map.t, (binary | :done -> any)) :: :ok

Helper to stream application logs as binary to a fun.

Examples

client |> Hexoku.API.LogSession.stream("myapp", &(IO.puts(&1)) )
Source