               files-str (for [file log-files]
                           (.getName file))
               reordered-files-str (conj (filter #(not= fname %) files-str) fname)
-              is-txt-file (re-find #"\.(log.*|txt|yaml|pid)$" fname)
               log-string (escape-html
-                           (if is-txt-file
+                           (if (is-txt-file fname)
                              (if start
                                (page-file path start length)
                                (page-file path length))

               length (if length
                       (min 10485760 length)
                       default-bytes-per-page)
              is-txt-file (re-find #"\.(log.*|txt|yaml|pid)$" fname)
              log-string (escape-html
                           (if is-txt-file
                             (if start
                               (page-file path start length)
                               (page-file path length))


(defn daemonlog-page [fname start length grep user root-dir]
  (if (or (blank? (*STORM-CONF* UI-FILTER))
        (authorized-log-user? user fname *STORM-CONF*))
    (let [file (.getCanonicalFile (File. root-dir fname))
          file-length (.length file)
          path (.getCanonicalPath file)
