[ 
https://issues.apache.org/jira/browse/STORM-901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14980619#comment-14980619
 ] 

ASF GitHub Bot commented on STORM-901:
--------------------------------------

Github user d2r commented on a diff in the pull request:

    https://github.com/apache/storm/pull/822#discussion_r43398781
  
    --- Diff: storm-core/src/clj/backtype/storm/daemon/logviewer.clj ---
    @@ -294,9 +418,55 @@ Note that if anything goes wrong, this will throw an 
Error and exit."
             (resp/status 404))
           (unauthorized-user-html user))))
     
    +(defn daemonlog-page [fname start length grep user root-dir]
    +  (if (or (blank? (*STORM-CONF* UI-FILTER))
    +        (authorized-log-user? user fname *STORM-CONF*)) ;; how to deal 
with this???????????
    +    (let [file (.getCanonicalFile (File. root-dir fname))
    +          file-length (.length file)
    +          path (.getCanonicalPath file)
    +          zip-file? (.endsWith path ".gz")]
    +      (if (and (= (.getCanonicalFile (File. root-dir))
    +                 (.getParentFile file))
    +            (.exists file))
    +        (let [file-length (if zip-file? (Utils/zipFileSize 
(clojure.java.io/file path)) (.length (clojure.java.io/file path)))
    +              length (if length
    +                       (min 10485760 length)
    +                       default-bytes-per-page)
    +              log-files (into [] (filter #(.isFile %) (.listFiles (File. 
root-dir)))) ;all types of files included
    +              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)
    --- End diff --
    
    We might have pulled this out into its own function, since it is used at 
least twice now. Not a big deal though.


> Worker Artifacts Directory
> --------------------------
>
>                 Key: STORM-901
>                 URL: https://issues.apache.org/jira/browse/STORM-901
>             Project: Apache Storm
>          Issue Type: New Feature
>          Components: storm-core
>            Reporter: Robert Joseph Evans
>            Assignee: Zhuo Liu
>         Attachments: daemon-logs-view.png, worker-logs-view.png
>
>
> At Yahoo we have added in a separate directory that stores a workers log 
> files, but also provides a place where the worker can place other files that 
> it might help with debugging.  It is a new directory in the current working 
> directory of the worker process.  The files in there are cleaned up if they 
> get too large, but provides a place for heap dumps GC logs, etc.
> This work is already done, but needs to be put back into open source.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to