ÔõÑùÔÚgitlabЧÀÍÆ÷¶ËÉó²éÈÕÖ¾
ÔÚgitlabÖÐÉó²éÈÕÖ¾ÊÇgitlabÖÎÀíÔ±¾ÙÐÐϵͳÖÎÀíºÍά»¤µÄÐëÒª²Ù×÷¡£gitlabÌṩÁ˸»ºñµÄ²Ù×÷ÈÕÖ¾£¬¿ÉÒÔÈÃÖÎÀíÔ±ÇáËÉÏàʶϵͳµÄÔËÐÐ״̬ºÍ²Ù×÷ÇéÐΣ¬ÊµÊ±·¢Ã÷ÎÊÌâ²¢¾ÙÐд¦Öóͷ£¡£ÏÂÃæÊÇÔÚgitlabЧÀÍÆ÷¶ËÉó²éÈÕÖ¾µÄÒªÁì¡£
Ò»¡¢µÇ¼GitLabЧÀÍÆ÷
ÔÚЧÀÍÆ÷ÉϵǼGitLabÖÎÀíÔ±Õ˺š£
¶þ¡¢½øÈëGitLab×°ÖÃĿ¼
½øÈëGitLab×°ÖÃĿ¼£¬Í¨³£Î»ÓÚ/opt/gitlabĿ¼Ï¡£
Èý¡¢Ê¹ÓÃcatÏÂÁîÉó²éÈÕÖ¾
ÔÚÖÕ¶ËÊäÈëÒÔÏÂÏÂÁî¿ÉÒÔÉó²éGitLabµÄÖ÷ÒªÈÕÖ¾£º
sudo cat /var/log/gitlab/gitlab-rails/production.log
¸ÃÏÂÁî»á½«production.logÖеÄËùÓÐÄÚÈÝÊä³öµ½Öնˡ£ÆäÖУ¬/var/log/gitlab/gitlab-rails/Ŀ¼Ï´洢ÁËGitLab RailsÓ¦ÓóÌÐòµÄÖ÷ÒªÈÕÖ¾Îļþ£¬¿ÉÒÔʹÓÃlsÏÂÁîÉó²éĿ¼ÏµÄËùÓÐÈÕÖ¾Îļþ¡£Ê¹ÓÃtailÏÂÁî¿ÉÒÔʵʱÉó²éÈÕÖ¾ÄÚÈÝ£¬È磺
tail -f /var/log/gitlab/gitlab-rails/production.log
ËÄ¡¢Éó²éGitLabÒì³£ÈÕÖ¾
GitLabÒì³£ÈÕÖ¾¿ÉÒÔ×ÊÖúÖÎÀíÔ±·¢Ã÷ϵͳÎÊÌ⣬¶¨Î»ÎÊÌâÔµ¹ÊÔÓÉ¡£ÔÚGitLabµÄ×°ÖÃĿ¼Ï¿ÉÒÔÉó²éÒì³£ÈÕÖ¾£º
sudo cat /var/log/gitlab/gitlab-rails/production_json.log
¸ÃÈÕÖ¾Îļþ¼Í¼ÁËGitLab RailsÓ¦ÓóÌÐòµÄJSONÒì³£ÐÅÏ¢¡£¿ÉÒÔʹÓÃcatÏÂÁîä¯ÀÀÕû¸öÎļþ£¬Ò²¿ÉÒÔͨ¹ýgrepÏÂÁî¿ìËÙ²éÕÒÌض¨Òì³£µÄÐÅÏ¢£¬ÀýÈ磺
sudo cat /var/log/gitlab/gitlab-rails/production_json.log | grep “error message”
Îå¡¢Éó²éÆäËûÈÕÖ¾
³ýÁËGitLab RailsÓ¦ÓóÌÐòµÄÖ÷ÒªÈÕÖ¾ºÍÒì³£ÈÕÖ¾Í⣬GitLabϵͳ»¹»á¼Í¼´øÓÐϵͳ×Ô¼ºÔËÐÐÏà¹ØÐÅÏ¢µÄÆäËüÈÕÖ¾¡£³£¼ûµÄÆäËûÈÕÖ¾Îļþ°üÀ¨£º
1.gitlab-shellÈÕÖ¾
gitlab-shell°üÀ¨ÁËÓÃÓÚ´¦Öóͷ£GitÏÂÁîÇëÇóµÄ»ù´¡Ó¦ÓóÌÐò£¬ÆäÈÕÖ¾ÎļþλÓÚ/var/log/gitlab/gitlab-shell/Ŀ¼Ï¡£
sudo cat /var/log/gitlab/gitlab-shell/gitlab-shell.log
2.unicornÈÕÖ¾
unicornÊÇGitLab RailsÓ¦ÓóÌÐòµÄЧÀÍÆ÷£¬ÆäÈÕÖ¾ÎļþλÓÚ/var/log/gitlab/unicorn/Ŀ¼Ï¡£
sudo cat /var/log/gitlab/unicorn/unicorn_stdout.log
ÒÔÉÏÊÇÔÚGitLabЧÀÍÆ÷¶ËÉó²éÈÕÖ¾µÄÒªÁ졣ͨ¹ýÉó²éÈÕÖ¾£¬ÖÎÀíÔ±¿ÉÒÔÏàʶGitLabϵͳµÄÔËÐÐ״̬ºÍ²Ù×÷ÇéÐΣ¬ÊµÊ±·¢Ã÷²¢½â¾öÎÊÌâ¡£
ÒÔÉϾÍÊÇÔõÑùÔÚgitlabЧÀÍÆ÷¶ËÉó²éÈÕÖ¾µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡