diff options
author | Håkon Hallingstad <hakon@verizonmedia.com> | 2020-12-02 13:50:21 +0100 |
---|---|---|
committer | Håkon Hallingstad <hakon@verizonmedia.com> | 2020-12-02 13:50:21 +0100 |
commit | f1e118db26efb6cfb16397e7997f441ba74382ea (patch) | |
tree | 53fe01281619ab1f86699705e82033a35bd88a3a /container-accesslogging | |
parent | f453ae5a89d9c5a4cd5926f8443a0acd564cbc86 (diff) |
Simplify symlink
The symlink points to a file in the same directory. Therefore, instead of
pointing to the absolute path, it should point to the filename. This also
makes the symlink work on the host, if the symlink was made in a container (and
vice versa).
Diffstat (limited to 'container-accesslogging')
-rw-r--r-- | container-accesslogging/src/main/java/com/yahoo/container/logging/LogFileHandler.java | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/container-accesslogging/src/main/java/com/yahoo/container/logging/LogFileHandler.java b/container-accesslogging/src/main/java/com/yahoo/container/logging/LogFileHandler.java index ab246a21a43..75e9febc192 100644 --- a/container-accesslogging/src/main/java/com/yahoo/container/logging/LogFileHandler.java +++ b/container-accesslogging/src/main/java/com/yahoo/container/logging/LogFileHandler.java @@ -298,14 +298,7 @@ public class LogFileHandler extends StreamHandler { if (symlinkName == null) return; File f = new File(fileName); File f2 = new File(f.getParent(), symlinkName); - String canonicalPath; - try { - canonicalPath = f.getCanonicalPath(); - } catch (IOException e) { - logger.warning("Got '" + e + "' while doing f.getCanonicalPath() on file '" + f.getPath() + "'."); - return; - } - String [] cmd = new String[]{"/bin/ln", "-sf", canonicalPath, f2.getPath()}; + String [] cmd = new String[]{"/bin/ln", "-sf", f.getName(), f2.getPath()}; try { int retval = new ProcessExecuter().exec(cmd).getFirst(); // Detonator pattern: Think of all the fun we can have if ln isn't what we |