Skip to content

Commit c43437f

Browse files
MB-61292: node_remap should call chronicle_env:setup()
Change-Id: Ia4855812bdc59159196aa75c2221b3d23a37fd2a Reviewed-on: https://review.couchbase.org/c/ns_server/+/213021 Tested-by: Timofey Barmin <[email protected]> Reviewed-by: Navdeep S Boparai <[email protected]> Well-Formed: Build Bot <[email protected]>
1 parent 353558c commit c43437f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

apps/config_remap/src/config_remap.erl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ rewrite_chronicle(#{?INITARGS_DATA_DIR := InputDir,
187187
output_path := OutputDir} = Args) ->
188188
?log_info("Rewriting chronicle"),
189189

190+
%% Required to re-use chronicle snapshot storage write fun
191+
ChronicleEnvDataDir = filename:join([OutputDir, ?CONFIG_DIR]),
192+
?log_debug("Rewriting chronicle files to ~p", [ChronicleEnvDataDir]),
193+
application:set_env(chronicle, data_dir, ChronicleEnvDataDir),
194+
application:set_env(chronicle, setup_logger_filter, false),
195+
ok = chronicle_env:setup(),
190196
LogsDir = filename:join(InputDir, ?CHRONICLE_LOGS_DIR),
191197
{ok, Logs} = file:list_dir(LogsDir),
192198
lists:foreach(
@@ -195,11 +201,6 @@ rewrite_chronicle(#{?INITARGS_DATA_DIR := InputDir,
195201
rewrite_chronicle_log(LogPath, Args)
196202
end, Logs),
197203

198-
%% Required to re-use chronicle snapshot storage write fun
199-
ChronicleEnvDataDir = filename:join([OutputDir, ?CONFIG_DIR]),
200-
?log_debug("Rewriting chronicle files to ~p", [ChronicleEnvDataDir]),
201-
application:set_env(chronicle, data_dir, ChronicleEnvDataDir),
202-
203204
SnapshotDir = filename:join(InputDir, ?CHRONICLE_SNAPSHOT_DIR),
204205
{ok, Snapshots} = file:list_dir(SnapshotDir),
205206
lists:foreach(

0 commit comments

Comments
 (0)