Back to Fuji Logging Aspect, or Fuji Logging Aspect Info
| At line 12 changed 1 line. |
| In Fuji Milestone 4 (M4), the aspects are taken a huge step forward to provide javafree aspects. Aspects user just need to specify set of properties to enjoy the aspects. |
| In Fuji Milestone 4 (M4), the aspects are taken a huge step forward to provide javafree aspects. Aspects user just need to specify a set of properties to enjoy the aspects. |
| At line 14 changed 1 line. |
| Once after having Fuji M4, here are the steps that are need to create Logging Aspects Project: |
| In Fuji Milestone 7 (M7), aspects can be created at command line. The command for creation of aspect is "create-aspect key=value[,key=value,*]". |
| At line 16 added 6 lines. |
| An example for creating an logging aspect. |
| -> fuji create-aspect name=Log-1 type=log status=Active log.content=Message |
| Alternatively, you can create aspects by the supported archetypes. Once after having Fuji, at least M4 version, here are the steps that are need to create Logging Aspects Project: |
| At line 30 changed 1 line. |
| You can specify any of the following interceptor proprties: |
| !!Interceptor related properties |
| You can specify any of the following interceptor related properties. You can refer [ How to write an Interceptor | FujiInterceptorHowToWrite ] for the recent supported properties. |
| At line 32 changed 6 lines. |
| name= This name is expected to be unique in Fuji runtime. By default, project name is chosen for this which always can be changed. |
| status=Active|Done|Error |
| message=IN|OUT|FAULT |
| service=.* |
| consumer=.* |
| provider=.* |
| ||Property || For logging, intercept Message Exchange based on |
| |name | Name of the Logging aspect. Must be unique in Fuji run time. By default, project name is chosen. |
| |provider | service provider |
| |consumer | service consumer |
| |message | message type : ( "in", "out") |
| |service | service name, can be the local name or the fully qualified service name |
| |endpoint | endpoint name |
| |status | message exchange status : {"DONE", "ERROR", "ACTIVE"} |
| At line 48 added 1 line. |
| !!Logging aspect related properties |
| At line 40 changed 14 lines. |
| aspect.identity |
| log.header |
| log.details |
| log.xpaths |
| log.token.<TokenName> |
| log.console |
| log.config.dir |
| log.config.files |
| log.config.patterns |
| log.config.uris |
| log.config.file.limit |
| log.config.file.count |
| log.config.file.append |
| log.config.file.formatter |
| ||Property ||Necessity||Description||Default Value |
| |log.content | Needed | Free form messages, tokens, Header/Status/Message/Properties/All<br />Ex: log.content=Status<br/>Ex: log.conent=Header,Properties<br/>Ex: log.content=First Name : {xpath://Employee/FName},Message,Status| Exchange:{exchangeid} Status:{status} |
| |log.xpaths | Optional | Logs evaluated XPath expressions. <vr/>Ex: /Employee/FName | None |
| |log.token.<TokenName> | Optional | User defined token.<br/>Ex: log.token.country={xpath://Employee/Country} <br/> and this country token can be used log.content as <br/>log.conent={xpath://Employee/FName} lives in {country}.| None |
| |log.console | Optional | True/False. Determines whether output is directed to console.<br/>Ex: log.console=true| If no other output option is chosen, its true. |
| |log.config.dir | Optional | Directory name where the specified log.config.files resides.| <FujiDir>\trunk\packaging\release-packages\felix\target\classes\fuji |
| |log.config.files | Optional | File names where logging is directed.| None |
| |log.config.patterns | Optional | The pattern for naming the output file. Refer: [http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/FileHandler.html]| None |
| |log.config.uris | Optional | URIs | None |
| |log.config.file.limit | Optional | the maximum number of bytes to write to any one file | 0 |
| |log.config.file.count | Optional | The number of files to use. | 1 |
| |log.config.file.append| Optional | true/false. Specifies append mode | true |
| |log.config.file.formatter| Optional | xml/simple | simple |
| |log.header | Optional | Entire log.content can be given a heading of your choice. <br/>Ex: log.header=***This logging is for my MATH CALCULATIONS debugging*******| None |
| |log.level | Optional | Logging level. This level need to be less restrictive than jdk logging level to log the log.content. | INFO |
| !!Tokens of logging aspect |
| A token is enclosed by curly brackets, {} and is evaluated for the value. A token can embed other tokens. The tokens are processed recursively until there are no valid tokens to evaluate. |
| !Built-in tokens |
| The following are built-in tokens. |
| role<br/> |
| endpoint.name/endpointname<br/> |
| message.type/messagetype<br/> |
| exchange.id/exchangeid<br/> |
| endpoint<br/> |
| service<br/> |
| operataion<br/> |
| pattern<br/> |
| status<br/> |
| error<br/> |
| fault<br/> |
| interface.name/interfacename<br/> |
| !in-place tokens |
| XPaths expressions and property expressions can be used as an in-place token, which will be evaluated while logging the content. |
| #XPath expression in-place token example: {xpath://Employee/FName} |
| #Property expression in-place token example: {property:groupid} |
| !!!Example of Logging Aspect |
| If the properties are, |
| {{{ |
| log.content = Attempt to invoke {operataion} on service {endpoint.name}., The message of { xpath://Employee/FName} with {property:groupid} is being processed and his Address = {Emp.Address} . He is from {Country}. |
| log.token.Emp.Address={Emp.FullName} {Emp.Company}, {xpath://Employee/Street}, {xpath://Employee/City}, {xpath://Employee/State} - {xpath://Employee/ZIP} |
| log.token.Country = {xpath://Employee/Country} |
| }}} |
| and if the input is: |
| {{{ |
| <Employee> |
| <EmpId>123</EmpId> |
| <FName>Ramesh</FName> |
| <LName>Dara</LName> |
| <Company>Sun Micro Systems</Company> |
| <Street>800, Royal Oaks Dr</Street> |
| <City>Monrovia</City> |
| <ZIP>91016</ZIP> |
| <State>CA</State> |
| <Country>USA</Country> |
| </Employee> |
| }}} |
| The output would be: |
| {{{ |
| Attempt to invoke {http://fuji.dev.java.net/application/myJRuby}requestReply on service transform_endpoint. |
| The message of Ramesh with 402af89d-cf28-4211-bb60-484b44fdb710 is being processed and his Address = Ramesh Dara, Sun Micro Systems, 800, Royal Oaks Dr, Monrovia, CA - 91016 . He is from USA. |
| }}} |