# Error logging for git over ssh?

3 messages from 2014-01-14 to 2014-01-15. Participants: Martin Langhoff, Duy Nguyen.
Thread: https://gitlist.dev/t/35657

## Martin Langhoff, 2014-01-14 18:44

Subject: Error logging for git over ssh?
Message-ID: <CACPiFCKBK49Zm8oYcGMVfmsgRwDrPyzWcU7vM6DwJeQitBNsnA@mail.gmail.com>
URL: https://gitlist.dev/e/CACPiFCKBK49Zm8oYcGMVfmsgRwDrPyzWcU7vM6DwJeQitBNsnA%40mail.gmail.com

```
Diagnosing errors with git over ssh has historically required tooling
up for debugging or looking at things from the client side, because
git does not log anything on the server side.

It would be a boon to those running busy git servers to be able to
diagnose by looking at a log. It can be both old-fashioned, or very
modern (if you are using journald).

After digging around the mailing list, current git master and "what's
cooking", I fail to see anything. Is there a built-in way in modern
git to direct stderr on the server side to a logger or to a file? (I
see git-daemon has some support, but it does not handle git ssh
connections...)

Some common "use cases" I've had to debug the hard way:

 - a ref is not up to date and the server rejects non-FF pushes
 - perms issues over objects or refs
 - ENOSPC
 - refs have a stale .lock file

cheers,



m
-- 
 martin.langhoff@gmail.com
 -  ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 ~ http://docs.moodle.org/en/User:Martin_Langhoff

```

## Duy Nguyen, 2014-01-15 01:51

Subject: Re: Error logging for git over ssh?
Message-ID: <CACsJy8Cp4Tw4_5px_fp4JY4TDdK2uH+1fYdiM8CBmbisbBbCmw@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8Cp4Tw4_5px_fp4JY4TDdK2uH%2B1fYdiM8CBmbisbBbCmw%40mail.gmail.com
In-Reply-To: <CACPiFCKBK49Zm8oYcGMVfmsgRwDrPyzWcU7vM6DwJeQitBNsnA@mail.gmail.com>

```
On Wed, Jan 15, 2014 at 1:44 AM, Martin Langhoff
<martin.langhoff@gmail.com> wrote:
> Diagnosing errors with git over ssh has historically required tooling
> up for debugging or looking at things from the client side, because
> git does not log anything on the server side.
>
> It would be a boon to those running busy git servers to be able to
> diagnose by looking at a log. It can be both old-fashioned, or very
> modern (if you are using journald).

Maybe we could put a "pager" program in front of stderr and let it
does the logging? We'll need to output the error side bands to stderr
too in case side-band is used.
-- 
Duy

```

## Martin Langhoff, 2014-01-15 04:40

Subject: Re: Error logging for git over ssh?
Message-ID: <CACPiFCLuqNMerSZhBtE=3X34Z9FYk+D9XukBzUOtuOWZKEqRGg@mail.gmail.com>
URL: https://gitlist.dev/e/CACPiFCLuqNMerSZhBtE%3D3X34Z9FYk%2BD9XukBzUOtuOWZKEqRGg%40mail.gmail.com
In-Reply-To: <CACsJy8Cp4Tw4_5px_fp4JY4TDdK2uH+1fYdiM8CBmbisbBbCmw@mail.gmail.com>

```
On Tue, Jan 14, 2014 at 8:51 PM, Duy Nguyen <pclouds@gmail.com> wrote:
> We'll need to output the error side bands to stderr
> too in case side-band is used.

Agreed, we'd need to "tee" the output so it gets to the logger _and_ to stderr.

I thought perhaps daemon.c would have something in this spirit, but
the trivial implementation is not what I had expected...

cheers,


m
-- 
 martin.langhoff@gmail.com
 -  ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 ~ http://docs.moodle.org/en/User:Martin_Langhoff

```
