Skip to content

Commit

Permalink
Merge pull request ManageIQ#22747 from jrafanie/pg_log_is_now_log
Browse files Browse the repository at this point in the history
pg_log changed to log in postgres 10 as default log directory
  • Loading branch information
bdunne authored Oct 23, 2023
2 parents 34f0a74 + 29c27ec commit 883525a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/models/miq_server/log_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def pg_log_patterns
return [] unless pg_data

pg_data = Pathname.new(pg_data)
[pg_data.join("*.conf"), pg_data.join("pg_log/*"), Pathname.new("/etc/manageiq/postgresql.conf.d/*")]
[pg_data.join("*.conf"), pg_data.join("log/*"), Pathname.new("/etc/manageiq/postgresql.conf.d/*")]
end

def log_start_and_end_for_pattern(pattern)
Expand Down
2 changes: 1 addition & 1 deletion spec/models/miq_server/log_management_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def stub_vmdb_util_methods_for_collection_log

it "pg_data_dir set" do
allow(@miq_server).to receive_messages(:pg_data_dir => '/var/lib/pgsql/data')
expected = %w(/var/lib/pgsql/data/*.conf /var/lib/pgsql/data/pg_log/* /etc/manageiq/postgresql.conf.d/*)
expected = %w(/var/lib/pgsql/data/*.conf /var/lib/pgsql/data/log/* /etc/manageiq/postgresql.conf.d/*)
expect(@miq_server.pg_log_patterns.collect(&:to_s)).to match_array expected
end
end
Expand Down
4 changes: 2 additions & 2 deletions tools/collect_logs/collect_archive_logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ source /etc/default/evm

tarball="log/evm_archive_$(uname -n)_$(date +%Y%m%d_%H%M%S).tar.xz"

if [[ -n "$APPLIANCE_PG_DATA" && -d "$APPLIANCE_PG_DATA/pg_log" ]]; then
if [[ -n "$APPLIANCE_PG_DATA" && -d "$APPLIANCE_PG_DATA/log" ]]; then
echo "This ManageIQ appliance has a Database server and is running version: $(psql --version)"
echo " Log collection starting:"
XZ_OPT=-9 tar -cJvf ${tarball} --sparse --warning=no-file-changed -X $collect_logs_directory/exclude_files BUILD GUID VERSION log/* config/* /var/log/* log/apache/* $APPLIANCE_PG_DATA/pg_log/* $APPLIANCE_PG_DATA/postgresql.conf
XZ_OPT=-9 tar -cJvf ${tarball} --sparse --warning=no-file-changed -X $collect_logs_directory/exclude_files BUILD GUID VERSION log/* config/* /var/log/* log/apache/* $APPLIANCE_PG_DATA/log/* $APPLIANCE_PG_DATA/postgresql.conf
else
echo "This ManageIQ appliance is not a Database server"
echo " Log collection starting:"
Expand Down
4 changes: 2 additions & 2 deletions tools/collect_logs/collect_current_logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ source /etc/default/evm

tarball="log/evm_current_$(uname -n)_$(date +%Y%m%d_%H%M%S).tar.xz"

if [[ -n "$APPLIANCE_PG_DATA" && -d "$APPLIANCE_PG_DATA/pg_log" ]]; then
if [[ -n "$APPLIANCE_PG_DATA" && -d "$APPLIANCE_PG_DATA/log" ]]; then
echo "This ManageIQ appliance has a Database server and is running version: $(psql --version)"
echo " Log collection starting:"
XZ_OPT=-9 tar -cJvf ${tarball} --sparse --warning=no-file-changed -X $collect_logs_directory/exclude_files --exclude="/var/log/messages-*" --exclude="/var/log/journal/*/system@*.journal" BUILD GUID VERSION log/*.log log/*.txt config/* /var/log/* log/apache/*.log $APPLIANCE_PG_DATA/pg_log/* $APPLIANCE_PG_DATA/postgresql.conf
XZ_OPT=-9 tar -cJvf ${tarball} --sparse --warning=no-file-changed -X $collect_logs_directory/exclude_files --exclude="/var/log/messages-*" --exclude="/var/log/journal/*/system@*.journal" BUILD GUID VERSION log/*.log log/*.txt config/* /var/log/* log/apache/*.log $APPLIANCE_PG_DATA/log/* $APPLIANCE_PG_DATA/postgresql.conf
else
echo "This ManageIQ appliance is not a Database server"
echo " Log collection starting:"
Expand Down

0 comments on commit 883525a

Please sign in to comment.