osa-eg / laravel-teams-notification

MIT License
9 stars 2 forks source link

Teams logging workflow error: InvalidParameter #4

Open henrikhb opened 2 months ago

henrikhb commented 2 months ago

Hi there thank you for your great work on this package.

I've successfully tested this package sending notifications in teams channel calling e.g. Log::channel('teams')->debug('This is an error message');

However I've encountered an error when adding it as a custom driver in config/logging.php like this:

    'channels' => [
        'stack'      => [
            'driver'            => 'stack',
            'channels'          => ['daily', 'teams'],
            'ignore_exceptions' => false,
        ],
        // ...
        'teams' => [
            'driver' => 'custom',
            'via' => \Osama\LaravelTeamsNotification\Logging\TeamsLoggingChannel::class,
            'webhook_url' => env('TEAMS_WEBHOOK_URL'),
            'level'    => env('LOG_LEVEL', 'critical'),
        ],
        // ...
    ]

Now when an error occurs it does trigger the webhook call, however the Teams workflow then fails:

Error
Action 'Post_card_in_a_chat_or_channel' failed
InvalidParameter

teams-workflow-error

Any clues how this can be solved?

osa-eg commented 2 months ago

Hi @henrikhb

Thank you for reaching out and your feedback on my package.

It’s great to hear that the package has been working well for direct logging calls. Regarding the issue you’re facing with the custom driver setup, I recommend ensuring that your package version aligns with v2.1.2, as I have confirmed this version operates correctly under similar testing conditions.

Additionally, could you please provide the version of Laravel you are using? This will help me replicate your environment more accurately and conduct further tests to better assist you.

Looking forward to your response!