« LogEvent (rtl) » : différence entre les versions
Aucun résumé des modifications |
mAucun résumé des modifications |
||
| (14 versions intermédiaires par un autre utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
{{ | {{Version700}} | ||
<source lang='delphi'>function logEvent(const iCategory,iAction | <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 11 : | Ligne 11 : | ||
|iCategory | |iCategory | ||
|Catégorie de l'évènement. | |Catégorie de l'évènement. | ||
|- | |||
|iModuleName | |||
|Module de l'évènement. | |||
|- | |- | ||
|iAction | |iAction | ||
|Action associé à l'évènement. | |Action associé à l'évènement. | ||
|- | |- | ||
| | |iKeys | ||
| | |Tableau de clé | ||
|- | |- | ||
| | |iValues | ||
| | |Tableau de valeur | ||
|- | |- | ||
| | |iDuration | ||
| | |Information de durée liée à l'évènement | ||
|} | |} | ||
| Ligne 34 : | Ligne 37 : | ||
|actionCategory | |actionCategory | ||
|iCategory | |iCategory | ||
|- | |||
|actionModule | |||
|iModule | |||
|- | |- | ||
|actionName | |actionName | ||
| Ligne 39 : | Ligne 45 : | ||
|- | |- | ||
|actionLabel | |actionLabel | ||
| | |iKeys[0] | ||
|- | |- | ||
|actionValue | |actionValue | ||
| | |iValues[0] | ||
|} | |} | ||
Ces attributs peuvent être utilisé dans les handlers d'évènement. | Ces attributs peuvent être utilisé dans les [[Gestion_des_évènements_(server)|handlers d'évènement]]. | ||
| Ligne 65 : | Ligne 68 : | ||
categories = sysevent,confevent,taskevent,processevent,event | 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]& \ | 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] | ec=[actionCategory]&ea=[actionName]&el=[actionLabel]&ev=[actionValue]&cm1=[actionValue1]&cd6=[actionModule] | ||
</pre> | </pre> | ||
| Ligne 71 : | Ligne 74 : | ||
<source lang='delphi'> | <source lang='delphi'> | ||
begin | begin | ||
logEvent('process','TProcessusComptabilisation','Nbr. pièce',100, | logEvent('process','TProcessusComptabilisation',['Nbr. pièce','Nbr. ecriture'],[100,1000]); | ||
end; | end; | ||
</source> | </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: | Voir aussi: | ||
* [[ | * [[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 —
}}