micahhausler / logspout-gelf

Logspout Adapter for Graylog's GELF
MIT License
28 stars 61 forks source link

Error building: modules.go:11:2: cannot find package #11

Closed phlegx closed 6 years ago

phlegx commented 6 years ago

I'm trying to build logspout with your module enabled as described in the README. Here is my quick and dirty shellscript with the actions I take:

#!/bin/bash

# Remove previously cloned directory
rm -rf logspout
git clone git@github.com:gliderlabs/logspout.git
cp config/modules.go logspout/
cd logspout && docker build -t logspout .

My custom modules.go file contains this:

package main

import (
    _ "github.com/gliderlabs/logspout/adapters/raw"
    _ "github.com/gliderlabs/logspout/adapters/syslog"
    _ "github.com/gliderlabs/logspout/httpstream"
    _ "github.com/gliderlabs/logspout/routesapi"
    _ "github.com/gliderlabs/logspout/transports/tcp"
    _ "github.com/gliderlabs/logspout/transports/udp"
    _ "github.com/gliderlabs/logspout/transports/tls"
    _ "github.com/micahhausler/logspout-gelf"
)

But I get the error:

modules.go:11:2: cannot find package "github.com/micahhausler/logspout-gelf" in any of:
    /go/src/github.com/gliderlabs/logspout/vendor/github.com/micahhausler/logspout-gelf (vendor tree)
    /usr/lib/go/src/github.com/micahhausler/logspout-gelf (from $GOROOT)
    /go/src/github.com/micahhausler/logspout-gelf (from $GOPATH)

Any ideas? thank you in advance!

enricocanardi commented 6 years ago

You have to add the logspout-gelf line to custom/modules.go, not to the modules.go in the root dir. br enrico

phlegx commented 6 years ago

@enricocanardi You can just follow this HOWTO. Worked for me: https://github.com/gliderlabs/logspout/tree/master/custom

4l1fe commented 6 years ago

Yep, faced the same problem. Should write it in Build section of this repo doc section

To build, you'll need to fork Logspout, add the following code to custom/modules.go

Thx anyway