Kernel::System::Log mit OTS6

Hilfe zu OTRS Problemen aller Art
Post Reply
BerndDasBrot2
Znuny newbie
Posts: 11
Joined: 06 Mar 2018, 09:52
Znuny Version: 6.0.1

Kernel::System::Log mit OTS6

Post by BerndDasBrot2 »

Hallo,

ich versuche in meinemn eigenen Modul log einträge zu generien.
Ich versuche es hier mit http://doc.otrs.com/doc/api/otrs/stable ... og.pm.html
Leider passiert nichts. Minimum log level ist debug. Level Output Versuch ist Info.

Liebe Grüße,
Björn
zzz
Znuny superhero
Posts: 889
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Kernel::System::Log mit OTS6

Post by zzz »

Hallo Björn,

Code: Select all

$Kernel::OM->Get('Kernel::System::Log')->Log(
    Priority => 'info',
    Message  => 'Hallo Log',
);
sollte eine Nachricht im Systemprotokoll/OTRS-Log hinterlassen, aber nicht im Webserver-Error-Log.

Viele Grüße
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
BerndDasBrot2
Znuny newbie
Posts: 11
Joined: 06 Mar 2018, 09:52
Znuny Version: 6.0.1

Re: Kernel::System::Log mit OTS6

Post by BerndDasBrot2 »

Hallo Emin,

nein, leider nichts.
Das sind die letzten Einträge:
Mon Mar 12 13:11:49 2018 error OTRS-CGI-10 Attempt to reload Kernel/Modules/AgentSupplierOverview.pm aborted.
Mon Mar 12 13:11:47 2018 error OTRS-CGI-10 Attempt to reload Kernel/Modules/AgentSupplierOverview.pm aborted.
Gruß,
Björn
zzz
Znuny superhero
Posts: 889
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Kernel::System::Log mit OTS6

Post by zzz »

Kommt Dein Code bis zur gewünschten Stelle durch?

Versuch doch mal an der gleichen Stelle einen Dump mit Data::Dumper zu erstellen und/oder die Priorität auf 'error' zu stellen.

Viele Grüße
Emin
Last edited by zzz on 02 Oct 2018, 09:36, edited 1 time in total.
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
BerndDasBrot2
Znuny newbie
Posts: 11
Joined: 06 Mar 2018, 09:52
Znuny Version: 6.0.1

Re: Kernel::System::Log mit OTS6

Post by BerndDasBrot2 »

Hallo Emin,

Ja, der log-versuch ist der erste Befehl in der RUN Function.
Dumper hatte ich als erstes probiert, dachte mir aber OTRS fängt das ab.
BerndDasBrot2
Znuny newbie
Posts: 11
Joined: 06 Mar 2018, 09:52
Znuny Version: 6.0.1

Re: Kernel::System::Log mit OTS6

Post by BerndDasBrot2 »

Ok,

nachdem ich die gesamte Kiste neugestartet habe, ging es plötzlich
BerndDasBrot2
Znuny newbie
Posts: 11
Joined: 06 Mar 2018, 09:52
Znuny Version: 6.0.1

Re: Kernel::System::Log mit OTS6

Post by BerndDasBrot2 »

Hallo Emin,

falls jemand in Zukunft Probleme meiner Art haben sollte, hier mal der Code für meinen post-receive hook:

Code: Select all

#!/bin/bash
TRAGET="<workspacedir>"
GIT_DIR="<gitdir>"
BRANCH="master"

while read oldrev newrev ref
do
        # only checking out the master (or whatever branch you would like to deploy)
        if [ "$ref" == "refs/heads/$BRANCH" ];
        then
                echo "Ref $ref received. Deploying ${BRANCH} branch to production..."
                git --work-tree=$TRAGET --git-dir=$GIT_DIR checkout -f
                /opt/module-tools/bin/otrs.ModuleTools.pl Module::File::Unlink <module name in /opt/module-tools/config.pl> /opt/otrs
                /opt/module-tools/bin/otrs.ModuleTools.pl Module::File::Link <module name in /opt/module-tools/config.pl >/opt/otrs
                /opt/otrs/bin/otrs.Console.pl Maint::Config::Rebuild --cleanup
                /opt/otrs/bin/otrs.Console.pl Maint::Cache::Delete
        else
                echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server."
        fi
done
Mir hat nämlich noch der Eintrag mit dem Cache delete gefehlt :/

Liebe Grüße,
Björn
zzz
Znuny superhero
Posts: 889
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Kernel::System::Log mit OTS6

Post by zzz »

Hallo Björn,

der Cache ist natürlich ein Klassiker :=)
Wenn Du schon dabei bist, kannst Du auch gleich den CSS und JS-Loader in der Systemkonfiguration deaktivieren.

Viele Grüße
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
Post Reply