deployphp / deployer

The PHP deployment tool with support for popular frameworks out of the box
https://deployer.org
MIT License
10.63k stars 1.49k forks source link

Make it easier to understand and debug issues #198

Closed tomzx closed 9 years ago

tomzx commented 9 years ago

At the moment, if you are in -vvv mode (debug), you get a RuntimeException if there's an issue while running deployer. However, I think it would be very useful to be able to inspect the complete output log of the comment if necessary.

Here's an example of what is currently outputted.

  [RuntimeException]                                                           
  npm WARN package.json -stripped-@0.0.1 No repository field.               
  npm WARN excluding symbolic link build/defs-config.json -> ../defs-config.j  
  son                                                                          
  sh: 1: gm: not found                                                         
  sh: 1: convert: not found                                                    
  npm WARN optional dep failed, continuing gmsmith@0.4.5                       
  sh: 1: phantomjs: not found                                                  
  npm WARN optional dep failed, continuing phantomjssmith@0.4.6                
  npm WARN engine pngjs@0.4.0: wanted: {"node":"0.8.x"} (current: {"node":"0.  
  10.36","npm":"1.4.28"})                                                      
  ./util/has_cairo_freetype.sh: line 4: pkg-config: command not found          
  gyp: Call to './util/has_cairo_freetype.sh' returned exit status 0. while t  
  rying to load binding.gyp                                                    
  gyp ERR! configure error                                                     
  gyp ERR! stack Error: `gyp` failed with exit code: 1                         
  gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node  
  _modules/node-gyp/lib/configure.js:343:16)                                   
  gyp ERR! stack     at ChildProcess.emit (events.js:98:17)                    
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js  
  :820:12)                                                                     
  gyp ERR! System Linux 3.2.0-23-generic                                       
  gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bi  
  n/node-gyp.js" "rebuild"                                                     
  gyp ERR! cwd /var/www/test-target/releases/20150225125802/node_modules/grun  
  t-spritesmith/node_modules/spritesmith/node_modules/canvassmith/node_module  
  s/canvas                                                                     
  gyp ERR! node -v v0.10.36                                                    
  gyp ERR! node-gyp -v v1.0.1                                                  
  gyp ERR! not ok                                                              
  npm WARN optional dep failed, continuing canvassmith@0.2.4                   

I suggest that by default, a deployer-$server_name.log file be created in the folder where execution happened and which contains either the full log of all the commands up to this point, or only of the command that failed.

antonmedv commented 9 years ago

I think logging is good thing. But must be implemented very careful. Now logging able by simple

deb deploy -vvv > deploy.log

Before implementing logs to file in Deployer we need to understand use cases and for what it's will be used. I think logging feature is good for v3.1 release of Deployer.