hapijs / good

hapi process monitoring
Other
525 stars 160 forks source link

[1] "ops" is not allowed [2] "reporters" is not allowed - Good + Glue #563

Closed ddhanak closed 6 years ago

ddhanak commented 7 years ago

I am trying to use Glue & Good together, when starting the server, I run into the following errors:

[1] "ops" is not allowed
[2] "reporters" is not allowed

Here is my code:

'use strict';

const Hapi = require('hapi');
const Glue = require('glue');

const goodOptions = {
    ops: {
        interval: 1000
    },
    reporters: {
        myConsoleReporter: [{
            module: 'good-squeeze',
            name: 'Squeeze',
            args: [{ log: '*', response: '*' }]
        }, {
            module: 'good-console'
        }, 'stdout'],
        myFileReporter: [{
            module: 'good-squeeze',
            name: 'Squeeze',
            args: [{ ops: '*' }]
        }, {
            module: 'good-squeeze',
            name: 'SafeJson'
        }, {
            module: 'good-file',
            args: ['./test/fixtures/awesome_log']
        }],
        myHTTPReporter: [{
            module: 'good-squeeze',
            name: 'Squeeze',
            args: [{ error: '*' }]
        }, {
            module: 'good-http',
            args: ['http://prod.logs:3000', {
                wreck: {
                    headers: { 'x-api-key': 12345 }
                }
            }]
        }]
    }
};

const manifest = {
    server: {
        //cache: 'redis'
    },
    connections: [
        {
            port: 8000,
            labels: ['api']
        },
        {
            port: 8001,
            labels: ['http']
        }
    ],
    registrations: [
        {
            plugin: {
                register: './routes',
                options: {
                    select: [ 'api' ]
                }
            }
        },
        {
            plugin: 'good',
            options: goodOptions
        }
    ]
};

const options = {
    relativeTo: __dirname
};

Glue.compose(manifest, options, (err, server) => {

    if (err) {
        throw err;
    }
    server.start(() => {

        console.log("The server has started");
    });
});
arb commented 7 years ago

You should move this to glue. Those options look fine to me.

csrl commented 6 years ago

The plugin and registration options were swapped in the manifest. This can be closed.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.