Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Master

## 0.7.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this from the PR? We'll update this when we are ready to publish a new version.

* Extra configuration that allows setting the maximum length to store for query params

## 0.6.0
* Extra configration that allows control of logging debug fields.
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The support policy is to support the last 2 major versions of Erlang and the thr

```elixir
def deps do
[{:plug_logger_json, "~> 0.6.0"}]
[{:plug_logger_json, "~> 0.7.0"}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this from the PR? We'll update this when we are ready to publish a new version.

end
```

Expand Down Expand Up @@ -49,6 +49,14 @@ config :plug_logger_json,
suppressed_keys: ["api_version", "log_type"]
```

The request parameters are truncated to a max length of 500 characters by default. This can be overridden by setting the `param_max_length` option.

```elixir
config :plug_logger_json,
param_max_length: 5000
```


### Configure the logger (console)

In your `config/config.exs` or `config/env_name.exs`:
Expand Down
3 changes: 2 additions & 1 deletion lib/plug/logger_json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ defmodule Plug.LoggerJSON do
end

defp format_value(value) when is_binary(value) do
String.slice(value, 0..500)
max = Application.get_env(:plug_logger_json, :param_max_length, 500)
String.slice(value, 0..max)
end

defp format_value(value) do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule PlugLoggerJson.Mixfile do
source_url: "https://github.com/bleacherreport/plug_logger_json",
start_permanent: Mix.env == :prod,
test_coverage: [tool: ExCoveralls],
version: "0.6.0",
version: "0.7.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this from the PR? We'll update this when we are ready to publish a new version.

]
end

Expand Down