« LogEvent (rtl) » : différence entre les versions
Aucun résumé des modifications |
mAucun résumé des modifications |
||
| (7 versions intermédiaires par un autre utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
{{ | {{Version700}} | ||
<source lang='delphi'>function logEvent(const iCategory,iModuleName,iAction:string; const iKeys:Array of variant; const iValues:Array of variant):boolean;</source> | <source lang='delphi'>function logEvent(const iCategory,iModuleName,iAction:string; const iKeys:Array of variant; const iValues:Array of variant; iDuration:Double):boolean;</source> | ||
Cette fonction permet d'émettre un évènement vers l'enregistreur de log. | Cette fonction permet d'émettre un évènement vers l'enregistreur de log. | ||
| Ligne 23 : | Ligne 23 : | ||
|iValues | |iValues | ||
|Tableau de valeur | |Tableau de valeur | ||
|- | |||
|iDuration | |||
|Information de durée liée à l'évènement | |||
|} | |} | ||
| Ligne 48 : | Ligne 51 : | ||
|} | |} | ||
Ces attributs peuvent être utilisé dans les [[ | Ces attributs peuvent être utilisé dans les [[Gestion_des_évènements_(server)|handlers d'évènement]]. | ||
| Ligne 77 : | Ligne 80 : | ||
<source lang='delphi'> | <source lang='delphi'> | ||
//Procedure TestLogEvent; | //Procedure TestLogEvent; | ||
var idx:Integer; keys:Array of string; values:Array of variant; | var idx:Integer; keys:Array of string; values:Array of variant; tk1,tk2:longint; | ||
begin | begin | ||
tk1 := GetTickCount; | |||
for idx:=0 to 9 do | for idx:=0 to 9 do | ||
begin | begin | ||
| Ligne 84 : | Ligne 88 : | ||
Values[idx] := idx; | Values[idx] := idx; | ||
end; | end; | ||
logEvent('process','GCF-Echeance',ClassName,Keys,Values); | tk2 := GetTickCount; | ||
logEvent('process','GCF-Echeance',ClassName,Keys,Values,TicktoMS(tk2-tk1)); | |||
end; | end; | ||
</source> | </source> | ||
| Ligne 94 : | Ligne 99 : | ||
* [[Tableaux_ouverts_(lang)|Tableaux ouverts]] | * [[Tableaux_ouverts_(lang)|Tableaux ouverts]] | ||
{{Footer| | {{Footer|Gestion_des_évènements_(server)}} | ||
[[category:Logger]] | [[category:Logger]] | ||
[[category: | [[category:Logs]] | ||
Dernière version du 20 novembre 2018 à 12:56
{{#images:version700-32x32.png|stock}} <source lang='delphi'>function logEvent(const iCategory,iModuleName,iAction:string; const iKeys:Array of variant; const iValues:Array of variant; iDuration:Double):boolean;</source>
Cette fonction permet d'émettre un évènement vers l'enregistreur de log.
| Result | True : L'évènement a été transmis |
| iCategory | Catégorie de l'évènement. |
| iModuleName | Module de l'évènement. |
| iAction | Action associé à l'évènement. |
| iKeys | Tableau de clé |
| iValues | Tableau de valeur |
| iDuration | Information de durée liée à l'évènement |
Cet évènement positionne les attributs suivants :
| Nom de l'attribut | Valeur de l'attribut |
|---|---|
| actionCategory | iCategory |
| actionModule | iModule |
| actionName | iAction |
| actionLabel | iKeys[0] |
| actionValue | iValues[0] |
Ces attributs peuvent être utilisé dans les handlers d'évènement.
Exemple :
Voici la déclaration du handler envoyant ce type d'évènement vers Google Analytics.
[\SOFTWARE\Sage\Ligne 1000\Administration\LOGManager\GA_EVENT]
type = http
url = http://www.google-analytics.com/collect
method = POST
contentType = application/x-www-form-urlencoded
accept = application/text
keep-alive = 0
categories = sysevent,confevent,taskevent,processevent,event
content = t=event&v=1&tid=[gaUA]&cid=[DeviceID]&cd1=[CustomerID]&cd2=[appName]-[appVersion]&cd3=[id]&cd4=[UserID]&cd5=[systemOSInfoEx]& \
ec=[actionCategory]&ea=[actionName]&el=[actionLabel]&ev=[actionValue]&cm1=[actionValue1]&cd6=[actionModule]
<source lang='delphi'>
begin
logEvent('process','TProcessusComptabilisation',['Nbr. pièce','Nbr. ecriture'],[100,1000]);
end; </source>
<source lang='delphi'> //Procedure TestLogEvent; var idx:Integer; keys:Array of string; values:Array of variant; tk1,tk2:longint; begin
tk1 := GetTickCount;
for idx:=0 to 9 do
begin
Keys[idx] := 'event'+inttostr(idx);
Values[idx] := idx;
end;
tk2 := GetTickCount;
logEvent('process','GCF-Echeance',ClassName,Keys,Values,TicktoMS(tk2-tk1));
end; </source>
| Tip : Ne pas passer de tableau statique, un type tableau statique n'est pas compatible avec un type tableau ouvert |
Voir aussi:
{{#if:Gestion_des_évènements_(server)|
{{#if:Gestion_des_évènements_(server)|— Gestion_des_évènements_(server) |}} — Développement DSM —
|
{{#if:|— [[{{{1}}}]] |}} — Développement DSM —
}}