SQL efetuado pelo Entity Manager (Avançado)

Saudações galera do GUJ!

  Estou com o seguinte problema:
    - Preciso [u]gravar em uma tabela do sistema[/u] o nome do usuário que logou no sistema e as [u]modificações ocorridas no banco de dados[/u](os SQL's).

  [i]Por uma questão de normas, devo utilizar JSF e JPA.[/i]

  Em minhas pesquisas, só descobri como fazer os sqls apresentarem na console do servidor de aplicações (Setando o tipo de log JPA como "FINE", no persistence.xml ).

  Alguém sabe como recuperar esses sqls durante a execução de um método do sistema? (por exemplo, dentro do managed bean)

Antecipadamente grato pela atenção,
Wellington Montefusco Anastácio

edit: Postei sem querer 3 vezes a mesma mensagem

edit: Postei sem querer 3 vezes a mesma mensagem

Any Help? :cry:

Bom… Acho que o jeito é partir pra outra estratégia de auditoria então… u.u

[quote=blobwell]Bom… Acho que o jeito é partir pra outra estratégia de auditoria então… u.u

[/quote]

[quote]Appenders and Layouts

The ability to selectively enable or disable logging requests based on their logger is only part of the picture. Log4j allows logging requests to print to multiple destinations. In log4j speak, an output destination is called an appender. Currently, appenders exist for the console, files, GUI components, remote socket servers, JMS, NT Event Loggers, and remote UNIX Syslog daemons. It is also possible to log asynchronously.

More than one appender can be attached to a logger.

The addAppender method adds an appender to a given logger. Each enabled logging request for a given logger will be forwarded to all the appenders in that logger as well as the appenders higher in the hierarchy. In other words, appenders are inherited additively from the logger hierarchy. For example, if a console appender is added to the root logger, then all enabled logging requests will at least print on the console. If in addition a file appender is added to a logger, say C, then enabled logging requests for C and C’s children will print on a file and on the console. It is possible to override this default behavior so that appender accumulation is no longer additive by setting the additivity flag to false.

The rules governing appender additivity are summarized below.

Fonte: Log4J[/quote]

Interesting… Thanks in Advance Felipe!

Nunca precisei entender essa api antes, mas parece que agora é o momento!

Farei alguns testes e se eu conseguir o resultado desejado eu posto aqui pra confirmar… Valeu!

Abs
Wellington M. Anastácio