Skip to content

Commit

Permalink
Better styling in upgrade guide
Browse files Browse the repository at this point in the history
  • Loading branch information
navinpeiris committed Jul 26, 2023
1 parent 34cecbb commit ddf8046
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions UPGRADE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,53 @@

1. Attach the new logger through telemetry events in your project's `application.ex` file:

```elixir
# lib/pixie/application.ex
def start(_type, _args) do
children = [
# ...
]

#
# Add the line below:
#
:ok = Logster.attach_phoenix_logger()

opts = [strategy: :one_for_one, name: MyApp.Supervisor]
Supervisor.start_link(children, opts)
end
```
```elixir
# lib/pixie/application.ex
def start(_type, _args) do
children = [
# ...
]

#
# Add the line below:
#
:ok = Logster.attach_phoenix_logger()

opts = [strategy: :one_for_one, name: MyApp.Supervisor]
Supervisor.start_link(children, opts)
end
```

2. Locate the line installing `Logster.Plugs.Logger` in your `endpoint.ex` file.

```elixir
plug Logster.Plugs.Logger,
# Configuration options such as those below might not be present
formatter: Logster.Plugs.JSONFormatter,
allowed_headers: ["content-type"],
excludes: [:params]
```
```elixir
plug Logster.Plugs.Logger,
# Configuration options such as those below might not be present
formatter: Logster.Plugs.JSONFormatter,
allowed_headers: ["content-type"],
excludes: [:params]
```

3. If configuration options were passed to `Logster.Plugs.Logger`, move them to `config.exs`:

```elixir
config :logster,
formatter: :json,
headers: ["content-type"],
excludes: [:params]
```
```elixir
config :logster,
formatter: :json,
headers: ["content-type"],
excludes: [:params]
```

NOTE: `allowed_headers` option has been renamed to `headers`
> NOTE: `allowed_headers` option has been renamed to `headers`
4. Remove the line installing `Logster.Plugs.Logger` from your `endpoint.ex` file.

5. Locate any calls to `Logster.Plugs.ChangeLogLevel` and rename it to `Logster.ChangeLogLevel`

6. Add the following to `config.exs` to disable the default Phoenix logger:

```elixir
config :phoenix, :logger, false
```
```elixir
config :phoenix, :logger, false
```

### Plug users:

Expand Down

0 comments on commit ddf8046

Please sign in to comment.